Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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?
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 wandering the Monastery: (17)
As of 2015-07-29 16:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (265 votes), past polls