Because you've already shifted out ARGV[0] so ARGV[1] is now ARGV[0].
I'd be inclined to:
use strict; use warnings; my ($based_on, $top) = @ARGV; $based_on ||= 'tp'; $top ||= 1; print "$based_on $top\n";
which is fine so long as $top can't == 0
In reply to Re: Ternary Operator for Multiple Arguments Passing
by GrandFather
in thread Ternary Operator for Multiple Arguments Passing
by neversaint
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |