in reply to Re: sub ($self,$var,@arr) {}
in thread sub ($self,$var,@arr) {}
Still, I find it nice that Perl allows you to use the parameters any way you wish, which is especially useful when you're passing parameters using the HASH-style methods, such that you really don't know how many parameters you are going to receive, nor what type they are:int main (argc, argv) int argc, char *argv[] { return 0; }
It is interesting that CGI.pm uses parameters in a way that is not unlike UNIX-style command-line arguments in terms of the way they are parsed and processed.MyFunc ( -type => qw ( lemur llama lynx ), -width => 150 );
Although MeowChow doesn't "want Perl to look any more like ... C,C++ or Java", that is no reason to not borrow methods and practices from these languages that were implemented with solid reasoning. The cliché "if it ain't broke" certainly hasn't been heeded by the Perl developers, Larry Wall included, because Perl 4.0 was hardly broken, and just when you think it couldn't get any better, it did!sub MyFunc ($$\$) { my ($x, $y, $z) = @_; # $x and $y are required, $z optional. }
|
|---|