Welcome to the Monastery | |
PerlMonks |
Re: Storing Lines before and After patternby Zaxo (Archbishop) |
on Jan 27, 2004 at 01:05 UTC ( [id://324326]=note: print w/replies, xml ) | Need Help?? |
This will break on every occurance of DOG, my @parts = split /DOG/, $poem; This will break on the first occurance, my ($before, $after) = split /DOG/, $poem, 2; You can also do things with regexes or substr, rindex, and index After Compline,
In Section
Seekers of Perl Wisdom
|
|