Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Practical example of "Is Perl code maintainable"

by eyepopslikeamosquito (Canon)
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2014-07-10 03:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (198 votes), past polls