IPC::Run::Simple

IPC::Run::Simple is a simple system() wrapper.
Download

IPC::Run::Simple Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Steve Fink
  • Publisher web site:
  • http://search.cpan.org/~sfink/IPC-Run-Simple-1.3/lib/IPC/Run/Simple.pm

IPC::Run::Simple Tags


IPC::Run::Simple Description

IPC::Run::Simple is a simple system() wrapper. IPC::Run::Simple is a simple system() wrapper.SYNOPSIS # Run a command and check whether it failed use IPC::Run::Simple; run("echo Hello, O Cruel World") or die "Command failed"; # Describe the failure use IPC::Run::Simple qw($ERR); run("echo Hello, O Cruel World") or die "Command failed: $ERR"; # Use the :all tag instead of explicitly requesting $ERR use IPC::Run::Simple qw(:all); run("echo Hello, O Cruel World") or die "Command failed: $ERR"; # Die with error message if command does not return 0 use IPC::Run::Simple qw(:Fatal); run("echo Hello, O Cruel World"); # Allow other exit values without dying use IPC::Run::Simple qw(:Fatal); run(command => , allowed => );This module is intended to be a very simple, straightforward wrapper around the system() call to make it behave more like other builtins.run() will return a true value if the command was executed and return a successful status code, and false otherwise. The reason for the failure will be stored in the $IPC::Run::Simple::ERR variable (which is just $ERR if you import either $ERR or :all). The description of the reason was pulled almost directly from the system() documentation.Optionally, you can import the :Fatal tag, which will cause run() to die() with an appropriate message if the command fails for any reason.If you wish to allow nonzero exit values but still want to trap unexpected errors, you may use an expanded call syntax. Call run() with a set of key=>value pairs. The two implemented keys are command (an array reference containing the command to run) and allowed (an array reference of exit values that are allowed without causing run() to return false or throw an exception.)Requirements:· Perl


IPC::Run::Simple Related Software