in reply to How to re-execute self?

If you use exec you'll "overwrite" the current instance of your script with a new invocation.

exec( $0, @ARGV ) or die "Can't re-exec myself: $!\n";

--
We're looking for people in ATL

Replies are listed 'Best First'.
Re^2: How to re-execute self? ($^X)
by tye (Sage) on Jun 15, 2005 at 18:54 UTC
    exec( $^X, $0, @ARGV ) or die "Can't re-exec myself($^X,$0): $!\n";

    doesn't require that $0 be written such that the kernel knows that it is a Perl script and might prevent the kernel from picking a different version of Perl than was originally used.

    - tye