[WHY not HOW] Re: [Israel.pm] Quickie - Perl syntax
Madani, Srikanth, VF-DE
Srikanth.Madani at vodafone.com
Wed Oct 6 05:07:04 PDT 2004
Omer Zak wrote:
>However, I am intrigued by the "Why".
>Given that you already wrote the code in question, "WHY" do you need to
>combine those statements into one line? (Besides the intellectual
>challenge of playing Perl Golf on this code snippet - in which case people
>normally try to solve the problem by themselves rather than ask in mailing
>lists.)
You are right on both counts - it was just about the Golf.
And the reason I addressed it to the list - I was being virtuous.
As the Perl man page says:
The three principal virtues of a programmer are Laziness, Impatience, and Hubris. :-)
Here's the solution:
my @tdir_val = ($line =~ m/^\s*(\S+)\s*=\s*(\S+)\s*$/);
Prompted by the third virtue :-),
Srikanth Madani
More information about the Perl
mailing list