in reply to IPC::System::Simple: Why isn't my exception caught?
capture('bash', '-o', 'pipefail', '-c', 'cat "$1" | wc -l', 'dummy', $file)
This also solves your problem with file names with spaces or other shell metachars.
This is just an example, right? Cause you could use the following or a small amount of Perl code.
capture('wc', '-l', $file)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: IPC::System::Simple: Why isn't my exception caught?
by karlgoethebier (Abbot) on Nov 20, 2013 at 20:24 UTC |