my $based_on = $ARGV[0] ? shift: 'tp'; my $top = $ARGV[0] ? shift: 1;#change here print "$based_on $top\n"; # Then the rest of the code
The problem is that when use use shift you are removing the first element of the array therefore after the shift the second arg is the first in the @ARGV list.
In reply to Re: Ternary Operator for Multiple Arguments Passing
by neosamuri
in thread Ternary Operator for Multiple Arguments Passing
by neversaint
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |