Just another Perl shrine | |
PerlMonks |
Re: New to Perlby jrtayloriv (Pilgrim) |
on Jun 23, 2010 at 21:05 UTC ( [id://846176]=note: print w/replies, xml ) | Need Help?? |
Also, if you are trying to grab lines based on the number of fields, you could do: do_something_with($line) if (@{[split / /, $line]} == 3); ... to grab all of the lines that have 3 fields in them. The following is a little faster, but throws a warning: do_something_with($line) if ((scalar split / /, $line) == 3); Of course, if you are looking at more than the number of fields, these won't be useful ... --jrtayloriv
In Section
Seekers of Perl Wisdom
|
|