use strict; use warnings; my @netstat = `netstat -s`; my @matches=("invalid headers", "packets dropped"); foreach my $matches (@netstat) { my @results = grep(/@matches/, @netstat); #print "I am here\n"; print @results; }
In reply to Trouble with foreach loop.... I think by u235sentinel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |