# Earlier stuff in the script... # Fill in the arguments if running remotely @ARGV ||= qw(%%REPLACEDTOKEN%%); # ... and back it out if @ARGV should really be empty @ARGV = () if $ARGV[0] eq "\%\%REPLACEDTOKEN\%\%"; # Rest of your script