in reply to Ternary Operator for Multiple Arguments Passing
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.
|
|---|