Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^4: I think Perl ruined me as a programmer

by Anonymous Monk
on Apr 12, 2010 at 05:36 UTC ( #834189=note: print w/replies, xml ) Need Help??


in reply to Re^3: I think Perl ruined me as a programmer
in thread I think Perl ruined me as a programmer

or, to avoid warnings about the occasional undefs in your arg list:
sub min { my $min; for (@_) { next unless defined; $min = $_ if $_ < $min } $min }

Replies are listed 'Best First'.
Re^5: I think Perl ruined me as a programmer
by Anonymous Monk on Apr 12, 2010 at 05:45 UTC
    oops, sorry..
    sub min { my $r; for (@_) { next unless defined; $r = $_ if !defined($r) || $_ < $r } $r }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2019-07-18 19:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?