Richard Clamp > Devel-System-0.01 > Devel::System

Download:
Devel-System-0.01.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.01   Source  

NAME ^

Devel::System - intercept calls to system to add extra diagnostics

SYNOPSIS ^

  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 / )'

DESCRIPTION ^

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.

Variables

The behaviour of the substitued system builtin can be swayed by the following package variables in the Devel::System namespace

$dry_run

Don't actually perform the command. Always returns $return

$return

The return value to use when $dry_run is active. Defaults to 0

$fh

The filehandle to print the diagnostics to. Defaults to \*STDERR

Options

In addition there are the following import symbols that you can use to set options from the commands line.

dry_run

Sets $dry_run to a true value.

CAVEAT ^

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

AUTHOR ^

Richard Clamp <richardc@unixbeard.net>

COPYRIGHT ^

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.

SEE ALSO ^

"system" in perlfunc

syntax highlighting: