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.
In reply to Re^2: CLASSPATH problem when using backticks
by ikegami
in thread CLASSPATH problem when using backticks
by maithree
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |