From: Abigail Subject: Re: I find the perl syntax easier than python Message-ID: Date: 03 May 2007 21:12:37 GMT David Formosa (aka ? the Platypus) (dformosa@usyd.edu.au) wrote on MMMMCMXCIII September MCMXCIII in : ^^ On 03 May 2007 19:21:12 GMT, Abigail wrote: ^^ ^^ > In Perl5, you aren't tempted to use named variables, so you get ^^ > your arguments in an array. And given an array, it's natural to ^^ > allow a variable number of arguments: ^^ > ^^ > ^^ > sub addprint {my $sum = 0; $sum += $_ for @_; print $sum, "\n"} ^^ ^^ So you do something like this ^^ ^^ sub addprint (*@num) { say [+] @num }; Yeah, but that's only on the second try. ;-) Abigail -- #!/opt/perl/bin/perl -w $\ = $"; $; = $$; END {$: and print $:} $SIG {TERM} = sub {$ := $_}; kill 15 => fork and ($; == getppid and exit or wait) foreach qw /Just another Perl Hacker/