Diab Jerius
Recent Actions
-
Commented on No One Is Immune to Abuse
Lots of stereotypes and assumptions being thrown around here, as well as some pretty grand generalizations. A community is defined by a set of common values and yes, a code of conduct of acceptable behavior. That's been part of human...
-
Commented on Where do you like bugs reported?
I prefer RT, because it's a permanent location. My code hosting may move (e.g. bitbucket stopped supporting mercurial, so I had to move my code elsewhere). Moving issues between hosting providers is lossy and messy. If my code repositories ever...
-
Commented on Preallocating scalars
And there's also Acme::SvGrow from back in the day, which uses either Data::Peek::DGrow, or the `push( '.' . $length)` approach....
-
Posted Preallocating scalars to Diab Jerius
I'm using the fabulous FFI::Platypus to interface to a C routine which uses caller-allocated buffers to return data. While
FFI::Platypus
transparently translates Perl arrays to C arrays and back, the buffers… -
Commented on The way to create Class with only Perl core language.
I've written a lot of code like that over the years. For simple classes, it works, and when I'm prototyping things I often use that approach. However, having to write accessors, including code for validation, etc., becomes a time sink....
-
Commented on The Future of Perl 5
I'd like to be able to do my %foo{@keys} = @vals; instead of my %foo; @foo{@keys} = @vals; I'd love for function signatures to handle types....
-
Commented on Trials and troubles with changing @INC
Thanks!...
-
Commented on How fast can you try?
Results and code updated....
-
Commented on How fast can you try?
Aargh TryCatch != Try::Catch. Disregard my remarks....
-
Commented on How fast can you try?
How embarrassing. There's a bug in the script. These lines: use if $ENV{TRY_TINY_TINY}, 'Try::Tiny::Tiny'; use if $ENV{TRY_TINY_MASTER}, lib => 'Try-Tiny-339b2ba3b0/lib'; Will not always result in Try::Tiny being loaded from my requested directory. They need to be swapped: use if $ENV{TRY_TINY_MASTER},...
-
Commented on How fast can you try?
I wouldn't call it entirely bogus, just for comparing TTM vs TT. If I rerun the benchmarks they change relative position, indicating that the differences are within measurement noise. The larger differences with and without TTT are real. The TryCatch...
-
Commented on How fast can you try?
I've added eval and Try::Tiny master. eval of course is fastest. The point of the benchmark wasn't to single out T::T::T. It didn't make sense to leave it out of a comparison of all of the Try::* modules. Had I...
-
Posted How fast can you try? to Diab Jerius
I just saw the release of Aristotle's Try::Tiny::Tiny to CPAN, which aims to speed up Try::Tiny. That led me to wonder how fast the various Try* modules were. I cannibalized the benchmark…
-
Commented on Perl Developer Survey 2017
Whoops, that came across as snarky; not my intention....
-
Commented on Perl Developer Survey 2017
Emacs isn't a listed choice for editors?...
-
Commented on So I Guess I'm Back
Welcome back!...
-
Commented on Invite Me (Virtually) To Your Next Perl Meetup
I attended (in person) and it did go quite well. One thing to keep in mind (for the hosts) is that you'll need a decent microphone setup to capture questions and comments from the audience. Often the questions had to...
-
Commented on Method Privacy in Perl
I've also been burned by overriding a "private" method in a parent class. Class::Method::Modifiers provides the fresh modifier, which will throw an exception if you override a method already defined by a parent class....
-
Commented on Let's delete 10,000 files from CPAN
Thanks for the reminder. Happy Northern Hemispheric Spring!...
-
Commented on Relief from Regexes
I'm a big fan of rxrx, which is part of Damian Conway's Regexp::Debugger package. A downside is the lack of command line history, but that can be dealt with using rlwrap. For those who haven't seen it in action, it...
-
Commented on Keep yer notes
Here's another for your notes binder: perlsecret...
-
Commented on Extracting values from a list of (key, value) pairs
@Graham Knop: I've fixed the code; thanks. @Aristotle: It actually seems to slow it down by a bit. Sequential runs with with your suggestion implemented, followed by the original code give: with: 1002/s 1016/s original: 1049/s 1075/s The difference between...
-
Commented on Extracting values from a list of (key, value) pairs
@QM: You've raised some good points. Yes, @k would have been a better choice than @v. My mistake. I'd fix the code, but then your comment would have no context. Why a short variable name? The focus here is on...
-
Commented on Extracting values from a list of (key, value) pairs
And just for completeness, I added direct assignment into the target array (idxa). As might be expected, it's significantly slower than pushing onto the end of the array (idxp)....
-
Commented on Extracting values from a list of (key, value) pairs
Thanks for adding that to List::Util. Peeking at your code led me to realize I'd forgotten to add straightforward array indexing. It's surprisingly fast. XS still wins, though....
-
Commented on Extracting values from a list of (key, value) pairs
A colleague pointed out I'd left out toggling using exclusive or; I've added that....
-
Posted Extracting values from a list of (key, value) pairs to Diab Jerius
If you need ordered key, value pairs, you can either use something like Tie::IxHash or a simple array of key, value pairs.
There are a number of…
-
Posted Automating POD previewing to Diab Jerius
I find it difficult to review documentation written in a markup language. I need to see that final pretty rendition of it as a manual page, PDF file or HTML web page before I can get a feeling if the thing makes sense. I also like to see that final rendition while I'm writing the document,…
-
Commented on Tool tip: looking at a module's source
My favorite: cpandoc -m...
-
Commented on p5-mop, a gentle introduction
I am concerned by the loss of 'undef' as a value for attributes. One of the benefits of having it is that it actually has intrinsic meaning. For example (pardon the pseudo-code) let's say that class Foo's constructor accepts an...
Comment Threads
-
Yuki Kimoto commented on
The way to create Class with only Perl core language.
OK, I think that is good one solution.
-
Yuki Kimoto commented on
The way to create Class with only Perl core language.
Everyone, Do you understand my OO code is for users which can't install modules into their server?
Do you think this is good code for them?
I also want to hear good points about my code, adding to negative points.
-
byterock commented on
The way to create Class with only Perl core language.
This was standard early way to do things from many years ago. 1980~90s. Now days we would call it Old Shcool.
https://www.perl.com/article/25/2013/5/20/Old-School-Object-Oriented-Perl/
I have had to do above in so called closed systems some time ago even wrote a module(Orignal) to help me out is such situations.
If I had to work on such a closed system today with and it had up to date perl I would go with Class::Struct as that is part of core
-
Toby Inkster commented on
The way to create Class with only Perl core language.
Hmm, looks like you're right. I thought this worked reliably.
-
Aristotle commented on
No One Is Immune to Abuse
You seem to be concerned about people liking you, so it could be anybody.
Buzzard, Buzzard. If you go around accusing people of not knowing the difference between empathy and sympathy, maybe you should not be making the same mistake. 🙂
About blogs.perl.org
blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.