my ($x, $y); if (@ARGV == 2){ ($x, $y) = @ARGV; } else { ... } package main; { print "$x, $y\n"; }