echo stuff | perl -ne 'BEGIN{ $x=shift @ARGV; } print "x=$x\n"' myarg