in reply to Possible Improvement to Shell.pm
If you wanted to really extend Shell.pm you might implement something like
or even things likeuse Shell cmdname => { exe => '/path/to/executable', capture_stderr => 1, params => [ '-foo', \1, '-bar', \2], }; # ... cmdname( $foo, $bar); # calling # /path/to/executable -foo '$foo' -bar '$bar' 2>&1
use Shell cmdname => { exe => '/path/to/executable', return => 'pid', }, othercmd => { return => 'handle', }; # ... my $pid = cmdname(@params) or die "... $^E"; my $handle = othercmd( @params2); while (<$handle>) { ... } close $handle;
|
|---|