Hello Perl list, I need to grab from an intel machine all lines with :5101 from netstat -a. If I dont group the regexp using parens then it prints all the needed lines. If I group the regexp using parens then it does not print all the needed lines. Any help and an explanation...I am confused now. thank you my $regexp = qr/.*\x3a5101.*/; open (NS, "$ns -|") or die "system call netstat '$ns' failed: $!"; print "Looking for 3191\t1026\t5051\t5101\n\n"; while (<NS>) { next if m|local\w+\x3a\d+|i; if (/$regexp/) { print $_; } } OR while (<NS>) { next if m|local\w+\x3a\d+|i; if (m|(.*\x3a5101.*)|g) { print ($1); } }
--------------------------------- Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta.