24 Sep 2000 01:27:25 UTC
- Distribution: Proc-SafePipe
- Module version: 0.01
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (340 / 39 / 0)
- KwaliteeBus factor: 0
- 91.67% Coverage
- License: unknown
- Activity24 month
- Download (2.62KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionROSCH Roderick Schertler
Proc::SafePipe - popen() and `` without calling the shell
$fh = popen_noshell 'r', 'decrypt', $input; ($fh, $pid) = popen_noshell 'w', 'ssh', $host, "cat >$output"; $all_output = backtick_noshell 'decrypt', $input; @lines = backtick_noshell $cmd, @arg;
These functions provide a simple way to read from or write to commands which are run without being interpreted by the shell. They croak if there's a system failure, such as a failed fork.
- popen_noshell mode command [arg]...
This function is similar to popen() except that the command and its related args are never interpreted by a shell, they are passed to exec() as-is. The mode argument must be
If called in an array context the return value is a list consisting of the filehandle and the PID of the child. In a scalar context only the filehandle is returned.
- backtick_noshell command [arg]...
This function runs the given command with the given args and returns the output, like
``does. The difference is that the arguments are not filtered through a shell, they are exec()ed directly.
The return value is either all the output from the command (if in a scalar context) or a list of the lines gathered from the command (in an array context). The exit status of the command is in $?.
Roderick Schertler <email@example.com>
Module Install Instructions
To install Proc::SafePipe, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Proc::SafePipe
For more information on module installation, please visit the detailed CPAN module installation guide.