in reply to Re: exec problem
in thread exec problem

"A supercomputer is a machine that runs an infinite loop in two seconds" ;-)

If you don't have a supercomputer at hand, consider modifying @ARGV and checking it so you can differentiate between the first and the second instance of the program:

BEGIN { unless ($ARGV[0] eq "-2ndcall") { print "\n ... starting BEGIN\n"; $ENV{LD_LIBRARYN32_PATH} = qw( /usr/path1 /opt/path2); unshift @ARGV, "-2ndcall"; exec 'env', $^X, $0, @ARGV; } }

Update: Fixed stupid mistake.