16.3. Replacing the Current Program with a Different OneProblemYou want to replace the running program with another, as when checking parameters and setting up the initial environment before running another program. Solution
Use the built-in exec("archive *.data") or die "Couldn't replace myself with archive: $!\n";
If you pass exec("archive", "accounting.data") or die "Couldn't replace myself with archive: $!\n";
If called with a single argument containing no shell metacharacters, the argument will be split on whitespace and then interpreted as though the resulting list had been passed to exec("archive accounting.data") or die "Couldn't replace myself with archive: $!\n"; Discussion
The
If you See Also
The
Copyright © 2002 O'Reilly & Associates. All rights reserved. |
|