Andrew Rodland
- About: Instant karma's gonna get you.
Recent Actions
-
Commented on Are Restricted/Locked Hashes A Failed Experiment?
They interest me very little, but I'm not sure how much of a failure they are. fields.pm does actually support some degree of compile-time checking if you do "my Type $var", but of course no one actually does. What I...
-
Commented on I start creating static perl
2008 was a long time ago....
-
Commented on What should Rakudo-js aim for first?
Node is the one *not* to go for IMO — Perl 6 isn't in need of another server-side runtime at the moment, and getting Perl 6's and Node's concurrency models to play together would be... interesting, actually, but also complicated...
-
Commented on How does <email>@cpan.org work?
I don't know of any mail that I'm not getting, but maybe I don't know because I'm not getting it....
-
Commented on Meta-Meta-Meta Problem Solving
The other day I saw t0m wearing this shirt. Sounds like you deserve one too....
-
Commented on Spelunking: why 'while(){ }' is my new favorite perl-ism
(And the commits from ??? until 2008 are real enough, but they were originally done in Perforce, of all things, and imported into git in 2008, when the git became the master repo.)...
-
Commented on Spelunking: why 'while(){ }' is my new favorite perl-ism
The commits from before Perl 5 or so aren't real git commits of course; they're perl releases gathered from Usenet and maybe other places and imported into git after the fact, and the commit messages are the associated release announcements....
-
Commented on Perl 5.19.x performance improvements
"return" is a control flow operation, it has to arrange to *leave* the sub from wherever it is. That's additional work compared to just leaving a value on the stack....
-
Commented on Web Services Part 2: Using Joyent
Debian has 5.14 in stable, actually....
-
Commented on The syntax of English is undecidable
Meaning informs parsing. Meaning, and prior experience, clearly have a big impact on how our brains interpret a series of words. But it's not absolutely necessary. We can see unfamiliar words, intuit a part of speech for them, and move...
-
Commented on YAPC::NA is 75% sold out!
I hope you're counting confirmed speakers in your attendance total, if you've got a hard limit....
-
Commented on I was called "fucking asshole"
You are unfit to live on a planet with human beings. Please stop....
-
Posted More Marpa Madness to Andrew Rodland
For the past year or so, I've been following the posts on Marpa with interest, but I never got around to writing anything with it, because honestly, the docs seemed a little bit opaque and incomplete to me.
Then, the other day, I…
-
Commented on Never ever trust Ubuntu
It's possible for a newer but more popular package to "win" after a couple of deprecation cycles. Since 2009, installing "git" will get you the git VCS, and installing "gnuit" will get you what used to be in the "git"...
-
Commented on Syntax police?
Then again, that ambiguity is *good* ambiguity if you like the idea of aliased.pm :)...
-
Commented on short CPANTS update
The one thing that confuses me endlessly -- why does the CPANTS grapher think that the year 2010 is both before and after the year 2008? http://cpants.perl.org/static/graphs/ARODLAND_dists.png...
-
Commented on Why the Lacuna Expanse is good for Perl
Now (not to belittle TLE at all), all we need is more. Because it's always embarrassing to have one awesome thing that everyone points out whenever a topic comes up. :)...
-
Commented on What are the best Perl one-liners you've written?
Not technically a oneliner because it's not standalone code, but one that I like anyway: cartesian product in one tweet. With the air let back into it, it's: use List::Util qw(reduce); sub list_product { reduce { [ map { my...
Comment Threads
-
Andreas Koenig commented on
Are Restricted/Locked Hashes A Failed Experiment?
kid51: short example
% perl -le '
use Getopt::Long;
use Hash::Util qw(lock_keys);
lock_keys %Opt, qw(mrg);
GetOptions(\%Opt, "mrg=i") or die;
if ($Opt{mgr}){
print "INT=$Opt{mrg}";
}
'
Attempt to access disallowed key 'mgr' in a restricted hash at -e line 6.An example that combines with Pod::Usage:
http://repo.or.cz/cpan-testers-parsereport.git/blob/HEAD:/bin/ctgetreports
-
Mikko Koivunalho commented on
Are Restricted/Locked Hashes A Failed Experiment?
For me lock_keys is a typo checker, also but not limited for production code, also but not limited for blessed hashed.
-
Toby Inkster commented on
Are Restricted/Locked Hashes A Failed Experiment?
Locked hashes are great, but if the implementation is slowing down all hashes, then I agree they should no longer be built in, and should be moved to a module
That said, I think it's an important enough feature that this module should be bundled with Perl, so that people relying on fields.pm (which was first released with Perl 5.5) and Hash::Util (Perl 5.8) won't need to install anything extra.
-
FUBAR commented on
Are Restricted/Locked Hashes A Failed Experiment?
I have used Hash::Utils more than once, specially in OOP projects that I was using "default" OOP model of Perl (not Moose or anything like that).
On the other hand, I usually don't start using it from scratch, usually when things starts to getting more complex and bugs starts to appear it is a sign that I should consider using it.
It is good to be have options... sometimes you need flexibility (like expanding a… -
simonde commented on
What are the best Perl one-liners you've written?
Nothing fancy, but it's handy when you want to pull IP addresses out of log files
cat /var/log/messages|perl -e 'while (>) {/(\d+\.\d+\.\d+\.\d+)/ && print "$1\n"};'
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.