What's better way to write this? I need something that will execute the right function based on the number of inputs. Eventually, what is a way to do this for N inputs?
Thanks for any help!
sub input { if ( $_[0] =~ /(.+)\s+(.+)\s+(.+)/) { print "3 params\n"; } elsif ( $_[0] =~ /(.+)\s+(.+)/) { print "2 params\n"; } elsif ( $_[0] =~ /(.+)/) { print "1 params\n"; } }
In reply to Perl newbie question. by yoda54
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |