in reply to Re^2: top and STDERR hell...
in thread top and STDERR hell...

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

Replies are listed 'Best First'.
Re^4: top and STDERR hell...
by DouglasDD (Beadle) on Jun 08, 2005 at 14:16 UTC
    Hmm, double-checked these and still get the same failing results. I can't explain the disparity between similar-sounding linux (procps) systems.

    Thanks for the data point.
    ./ddd