> > my $option = defined $ARGV[0] ? $ARGV[0] : "default";
>
> Didn't we already go through all of this a few hours ago? Randal (of
> course) came up with the most succint solution:
>
> my $option = @ARGV ? shift : <DEFAULT VALUE>;
>
Sorry for trying to be helpful.
Mailing list arent represented in threads in outloko express so pretty hard
to find all the anwers between 300 unread messages.
Above option only works for 1 parameter tho (and commandline arguments).
For function calls i like to use 'named parameters' by accepting a hash of
options.
sub foo{
my %options = @_;
}
Maarten.