in reply to Ternary Operator for Multiple Arguments Passing

you are shifting when $ARGV[0] is true, then your second argument is in $ARGV[0], too.

It has to be
my $based_on = $ARGV[0] ? shift: 'tp'; my $top = $ARGV[0] ? shift: 1; print "$based_on $top\n";


But I would recommend to use Getopt::Long