Alien-Selenium
view release on metacpan or search on metacpan
inc/IPC/Cmd.pm view on Meta::CPAN
my $cmd = "$full_path -b theregister.co.uk";
my $cmd = [$full_path, '-b', 'theregister.co.uk'];
### in scalar context ###
if( run(command => $cmd, verbose => 0) ) {
print "fetched webpage succesfully\n";
}
### in list context ###
my( $succes, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
run( command => $cmd, verbose => 0 );
if( $success ) {
print "this is what the command printed:\n";
print join "", @$full_buf;
}
### don't have IPC::Cmd be verbose, ie don't print to stdout or
### stderr when running commands -- default is '0'
$IPC::Cmd::VERBOSE = 0;
=head1 DESCRIPTION
IPC::Cmd allows you to run commands, interactively if desisered,
platform independant but have them still work.
The C<can_run> function can tell you if a certain binary is installed
and if so where, whereas the C<run> function can actually execute any
of the commands you give it and give you a clear return value, as well
inc/My/Tests/Below.pm view on Meta::CPAN
use IPC::Open3;
use File::Spec;
use Fatal qw(mkdir chdir);
=begin internals
=head2 Tests over the __END__ test section for real modules
=head3 run_perl($filename)
Runs Perl on $filename, returning what we got on stdout / stderr.
$? is also set.
=cut
sub run_perl {
my ($filename) = @_;
my ($stdin, $stdout) = map { new IO::Handle } (1..2);
my ($perl) = ($^X =~ m/^(.*)$/); # Untainted
my $pid = open3($stdin, $stdout, $stdout,
$perl, (map { -I => $_ } @INC), '-Tw', $filename);
( run in 1.148 second using v1.01-cache-2.11-cpan-49f99fa48dc )