with this:while(<FILE>) { ...
and it does exactly the same thing.for (split "(?<=\Q$/\E)", $contents_of_FILE) { ...
Which just means: split the content of the file on the zero-width positive lookbehind assertion of $/ (the input record separator). This is subtley different from just splitting on $/ (or, more safely, splitting on \Q$/\E), in that splitting on $/, itself, removes $/ from the output of the split... whereas splitting on the zero-width positive lookbehind assertion leaves it in. (This is because what is being splitted on is the empty string following each occurence of $/, so that is the thing that gets removed).
Anyway, this may not be the best way to deal with the situation of your problem, but it is the most general solution for dropping in a replacement of a <FILE> loop with some sort of loop over the contents of FILE.
In reply to Re: addn'l help with parsing here doc
by etcshadow
in thread addn'l help with parsing here doc
by smackdab
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |