So, I'm an utter noob learning Perl for work--and hopefully once I'm decent, to actually do things as well. Nonetheless, I'm trying to do an exercise in the O'Reilly camel book, but I can't get this subroutine working correctly:
my $sum = shift(@_);
$sum += @_;
Any help? It always adds up to 17 when I include it in a script which throws in any number of arguments.
Also: I'm trying to be more 'Perl Zen' but my code above looks like it'd be best friends with the cold and rigid likes of C++ or Java. Any tips for 'Perl'ifying this?