It seems to me that your problem is in your control mechanisms, specifically that your if statement should be inside of a while statement that goes through your data line by line. Also maybe a global variable to keep track of matches. If you're reading a file, then you'll have something like:
my $matches = 0; open FILE, ">filename.txt" or die $!; while (my $ethernet = <FILE>) {
if ($ethernet=~/eth1\.\d{4}\@/m){ ## do something matches++; } }
In reply to Re: A regex question.
by Aldebaran
in thread A regex question.
by FeistyLemur
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |