> my $timex = `(timex ps -ef > /dev/null) 2>&1`;  # /dev/null 
> has 2 ells on 
> my system
> $timex =~ tr/\n//s;   # Embedded and trailing blank lines
> $timex =~ s/^\n//;    # Leading blank line

        @oratime = qx((timex  ps -ef > /dev/null) 2>&1 );
        foreach my $holder (@oratime) {
        $holder =~ tr/\n//s;
        $holder =~ tr/^\n//;
        $holder =~ s/^\s+//;
        print ": $holder\n";
        my ($key,$value) = split($holder);
        $otime{$key} = $value;
}

results in:
: 
Use of uninitialized value at ./beta.pl line 60.
Use of uninitialized value at ./beta.pl line 61.
Use of uninitialized value at ./beta.pl line 61.
: real        0.06

Use of uninitialized value at ./beta.pl line 60.
Use of uninitialized value at ./beta.pl line 61.
: user        0.04

Use of uninitialized value at ./beta.pl line 60.
Use of uninitialized value at ./beta.pl line 61.
: sys         0.01

Use of uninitialized value at ./beta.pl line 60.
Use of uninitialized value at ./beta.pl line 61.
: 
looks like the blank/null lines still be there :( I have tried
several approaches. I am about to say screw it and | tail -4 | head -3 which
will remove the lines during the run of the command....

Reply via email to