Cool/useful short examples of Perl?

Avleen Vig avleen at gmail.com
Mon May 30 23:05:51 BST 2011


On Mon, May 30, 2011 at 4:47 PM, Uri Guttman <uri at stemsystems.com> wrote:
> if you think that is line noise, then your perl skills need
> improving. seriously i have taught the slurp line to total beginners and
> they get it afterwards. this is for learn.perl.org, not golf.
>
>  my %conf = read_file( $file_name ) =~ /^(\w+)=(.*)$/mg ;
>
> that is an assigment to hash, scalar context call on read_file and a
> regex getting out key=val lines. all stuff newbies need to know and must
> learn. it happens to use them all in one basic line. it is all a very
> teachable thing to anyone who knows what a hash, sub call and regex
> are. i don't expect newbies to know how to read that line but i do
> expect them to able to learn from it. that is what proper training is
> about. not feeding pablum to kiddies.

I mostly idle on this list since I moved back to the US, but this is
something that really irks me.
This is exactly why other languages are getting promoted more than perl:
because people insist on promoting the things about perl that make it
unmaintainable and harder to read, rather than the strengths about how
expandable it is, the massive collection of modules, backwards
compatibility between versions (mostly), and speed.



More information about the london.pm mailing list