http://www.perlmonks.org?node_id=652692


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

that min functions looks kinda funny, and in some ways manages to expose the dangers of writing lazy (ie, terse) perl.
sub min { my $min = shift; foreach (@_) { $_ = $min if $_ < $min; } return $min; } @a = (10, 5, 8, 2, 1, -4); $min = min(@a); print "min of @a is $min\n";
produces: min of 10 10 10 10 10 10 is 10

probably not what you expected! not only did it give the wrong answer, it destroyed the input list!