Devel::System - intercept calls to
system to add extra diagnostics
use Devel::System; $Devel::System::dry_run = 1; # don't really do it system qw( rm -rf / );
or from the command line:
perl -MDevel::System=dry_run -e'system qw( rm -rf / )'
Devel::System hooks the system builtin to add diagnostic output about what system calls are being made. It's like the -x switch for /bin/sh all over again.
The behaviour of the substitued
system builtin can be swayed by the following package variables in the
Don't actually perform the command. Always returns $return
The return value to use when $dry_run is active. Defaults to 0
The filehandle to print the diagnostics to. Defaults to \*STDERR
In addition there are the following import symbols that you can use to set options from the commands line.
Sets $dry_run to a true value.
Devel::System must be used before any other code that has a call to system in order for it to be used in preference of the built-in. This should normally be easilly arranged via the command line as shown in "SYNOPSIS" or via "PERL5OPTS" in perlrun
Richard Clamp <email@example.com>
Copyright (C) 2003 Richard Clamp. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.