Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Practical example of "Is Perl code maintainable"

by eyepopslikeamosquito (Chancellor)
on Aug 13, 2007 at 08:49 UTC ( #632161=note: print w/replies, xml ) Need Help??

in reply to Practical example of "Is Perl code maintainable"

Just found another:

sub file_size { my ($file) = @_; if( ! -f $file ) { return 0; } my $dummy; my $size; ($dummy,$dummy, $dummy, $dummy, $dummy, $dummy, $dummy, $size, $dumm +y, $dummy, $dummy, $dummy, $dummy) = stat($file); return $size; }
which was either written because he never heard of -s or maybe to silence warnings when the file does not exist. I'm tempted to replace it with:
sub file_size { -s shift || 0 }

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://632161]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2016-10-25 04:52 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (315 votes). Check out past polls.