Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

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 }

Comment on Re: Practical example of "Is Perl code maintainable"
Select or Download Code

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 browsing the Monastery: (3)
As of 2015-11-25 03:37 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (670 votes), past polls