Cookie Notice

As far as I know, and as far as I remember, nothing in this page does anything with Cookies.

2009/10/19

Modern One-Liner Perl

I have never been much of a fan of Perl one-liners. Take every slur about Perl that exists in the popular imagination, and that's the reality for one-liners.

perl -e 'print 51 * 51 , "\n"'
But now, by going -E instead of -e, you bring in Perl 5.10. This means you get say, which is by far my fave Perl 5.10 addition.

perl -E 'say 51 * 51'
I'm already starting to do one-liners more, now that I have say. Using realias is also helpful with this.

Credit where due.



2 comments: