a question regarding the use of Split operator in Perl

Paul Lussier p.lussier at comcast.net
Wed Sep 12 20:04:56 EDT 2007


"Ben Scott" <dragonhawk at gmail.com> writes:

>   You don't need to put parenthesis around arguments to split, and you
> don't need to explicitly specify the default pattern match target
> ($_).

Unfortunately, you both "don't *need* to" and "*can* do" anything in
perl.  Often at the same time!  This is what leads to very difficult
to read, and more difficult to maintain perl code.

While you don't *need* to put parenthesis around the args to split, or
most any perl function, and you don't *need* to specify the default
pattern match target, it is considered a "best practice" to do so.

I highly recommend Damian Conway's book "Perl Best Practices", which
outlines these and many other useful pieces of advice.
-- 
Seeya,
Paul


More information about the gnhlug-discuss mailing list