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,
Zaxo
In reply to Re: Storing Lines before and After pattern
by Zaxo
in thread Storing Lines before and After pattern
by Hoot
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |