I thought using the split function would be the best way to go.As an alternative you can also set the input record separator to space:
See $/ for more information about the input record separator.use strict; use warnings; local $/ = ' '; while ( <DATA> ) { print "$_\n" if ( /p/i ); } __DATA__ CPAN stands for comprehensive Perl Archive Network. ^ and $ are used as anchors in a regular expression. /pattern/ is a pattern match operator. Perl is very easy to learn. Enter 'H' or 'h' for help.
In reply to Re: Help with split() function
by carol
in thread Help with split() function
by negzero7
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |