Scriptalicious
view release on metacpan or search on metacpan
lib/Scriptalicious.pod view on Meta::CPAN
run( -out => \*MYOUT,
-out2 => \*MYOUT,
@command );
Any filehandle can be opened in any mode; C<-in> merely defaults to
meaning C<-in0>, and C<-out> defaults to meaning C<-out1>. There is
no C<-err>; use C<-out2>. C<-rw> exists (defaulting to C<-rw0>), but
is probably of limited use.
Here is an example of using C<prompt_passwd()> to hijack C<gpg>'s
password grabbing;
my $password = prompt_passwd("Encryption password: ");
my $encrypted = run( -in4 => sub { print "$password\n" },
"gpg", "--passphrase-fd", "4", "-c", $file )
=item B<run_err("command", "arg2", "arg1")>
Same as run, but returns the error code rather than assuming that the
command will successfully complete. Again, output it suppressed.
=item B<capture("command", "1gra", "2gra")>
runs a command, capturing its output, barfs if there is a problem.
Returns the output of the command as a list or a scalar.
( run in 0.523 second using v1.01-cache-2.11-cpan-df04353d9ac )