wrote:
)> Please post a short but complete program to show us what you are doing,
)> as is suggested in the posting guidelines for this group:
http://www.rehabitation.com/clpmisc/...uidelines.html
)>
)> --
)> Gunnar Hjalmarsson
)> Email:
http://www.gunnar.cc/cgi-bin/contact.pl
) Well that depends of the question, the question is very straight
) forward, anyway here is portion of the code..again thanks..
)
) my $cmd = "ps -eo pcpu,pid,user,args";
) my @output = '$cmd';
) foreach my $line (@output) {
) next if $line =~ /\s0.0/; # skip 0.0
) print $line, "\n";
) }
First: The dot matches any character in a regexp.
Second: I don't see the caret at the start of the regexp to anchor it.
This will probably result in spurious matches.
Third: The lines will already have newlines on them so the extra one
in the print statement will produce blank lines.
Oh, and fourth: in the original question, I *did* see the caret at the
start, which made the question impossible to answer as such, let alone
straight forward. This is one reason why the best way is to copy-paste
the relevant bits of your code. All characters count.
SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT