my @lines = split /(\n)/, $data; foreach (@lines) { do_something() if /pattern/; } $data = join '', @lines;
Hi James.
I'm not sure if the group saw all of the dialogue? Later postings seem to assume an enclosing loop as you wrote above.
It seems wasteful to split $data like that and process each record (including the alternate "\n" separators) when you could probably just process the entire string using the /m (multi-record) qualifer on the regex (which is exactly what it was meant for).
That's what we settled on too. You're right, I should have just wrote it that way to begin with. Thanks for the advice.
James
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]