if( ! $ENV{PDUPRE_RESTART}) { $ENV{PDUPRE_RESTART} = 1; print "Restarting as '$0, @ARGV'\n"; ... exec $0, @ARGV or print "Exec error when restarting $0 @ARGV: $!"; exit 1; }; #### if( ! grep { /^--restarted$/ @ARGV) { print "Restarting as '$0 --restarted @ARGV'\n"; exec $0, '--restarted', @ARGV or print "Exec error when restarting $0 @ARGV: $!"; exit 1; };