perl -MO=Deparse -s simple.pl -test=SET_VIA_-s arg1 inside BEGIN @ARGV is [arg1] and $test is [SET_VIA_-s] sub BEGIN { print "inside BEGIN \@ARGV is [@ARGV] and \$test is [$test]\n"; } my $test = 'original value'; print "inside main \@ARGV is [@ARGV] and \$test is [$test]\n"; simple.pl syntax OK