in reply to This is why Perl is so frustrating
I would replace that rather clunky
if (($file ne ".") or ($file ne "..")) {
with the more elegant
unless ( $file eq "." || $file eq ".." ) {
because it reads more naturally. In fact, since parsing the file is the only thing that's happening inside the loop, I would just skip the file entirely with
next if ( $file eq "." || $file eq ".." );
There might be responses to my post for calls to make a regular expression out of this, but it's not really necessary.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: This is why Perl is so frustrating
by wfsp (Abbot) on Jul 30, 2009 at 07:08 UTC | |
by talexb (Chancellor) on Jul 30, 2009 at 13:58 UTC |