in reply to Re: CLASSPATH problem when using backticks
in thread CLASSPATH problem when using backticks
No need for open3.
sub backticks { open(my $pipe, '-|', @_) or return; local $/ = wantarray ? $/ : undef; <$pipe> } my $java_output = backticks('java', '--classpath=...', ...);
Bonus: Handles context and errors just like the real thing.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: CLASSPATH problem when using backticks
by pc88mxer (Vicar) on May 21, 2008 at 18:23 UTC | |
by ikegami (Patriarch) on May 22, 2008 at 07:08 UTC |