in reply to Re: Getting a script to re-run itself
in thread Getting a script to re-run itself

Even better would be to use $0 as the parameter to exec.
exec $0 unless $all_done;
That way the script can move around on the filesystem and you won't need to hand edit it.

A warning: the above doesn't work correctly under Windows. For some reason, exec $0 spawns another copy of your script in the background. If you write a small test program like:

print "hi!\n"; sleep 2; exec $0;
and run it, you get the effect of:
H:\>test.pl hi! hi! H:\>hi! hi! hi!
What exactly it is doing, I don't know :)

mr.nick ...