Actually, it's not a backtick thing; that was just the first thing I tried; when I run your code I also get the desired results. Specifically:
# lll.pl sub longestLineLength { my $longestLen = undef; for my $l ( @_ ) { if ( length($l) > $longestLen ) { $longestLen = length($l); } } return $longestLen; } 1; # propitiatory offering for require __END__ # test03.pl use strict; use warnings; require "lll.pl"; open (TOP, "COLUMNS=1000 /usr/bin/top -bcS -n 1 2>err.txt|") || die "open pipe from top failed $!"; print longestLineLength( <TOP> ) . "\n"; __END__ % perl test03.pl 208
the lowliest monk
In reply to Re^3: top and STDERR hell...
by tlm
in thread top and STDERR hell...
by DouglasDD
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |