in reply to Array size issue
This is where your trouble is. You probably meant to write it thusly:if($line =~ m/ on $ipaddress/) { if (scalar(@matches) <= 2){ push(@matches, $line); } else { exit(0); } foreach $line (@matches){ print "$line\n"; } }
if($line =~ m/ on $ipaddress/) { if (scalar(@matches) <= 2){ push(@matches, $line); } else { foreach $line (@matches){ print "$line\n"; } exit(0); } }
Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Array size issue
by hmb104 (Sexton) on Oct 15, 2012 at 18:17 UTC | |
by blue_cowdawg (Monsignor) on Oct 15, 2012 at 18:45 UTC | |
by hmb104 (Sexton) on Oct 15, 2012 at 19:03 UTC | |
by blue_cowdawg (Monsignor) on Oct 15, 2012 at 20:43 UTC |
In Section
Seekers of Perl Wisdom