You could try to split your parameter and access the number of elements ... something like this:
my @nr = split (/\s+/, $_[0]); print ($#nr+1, " params \n");
However you might want to do some fine-tuning ... the code above won't work correctly for parameters starting with whitespaces
HTH, Rata
update: or as an one-liner: print (scalar(split (/\s+/, $_[0])), " params \n");
In reply to Re: Perl newbie question.
by Ratazong
in thread Perl newbie question.
by yoda54
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |