in reply to Re: Alternative to Substr?
in thread Alternative to Substr?

This assumes that $match only occurs once in the string

No it does not. Perl will take the first match.

and that you want everthing after that point.

Your RE won't deliver the rest of the string in a very common circumstance as . does not match a newline until you add /s

Replies are listed 'Best First'.
Re^3: Alternative to Substr?
by TheEnigma (Pilgrim) on Sep 29, 2004 at 13:14 UTC
    Both very good points. But like I said, I had to make some assumptions, not knowing what his data looks like or what he wants to extract from it.

    If $match did occur more than once, I don't know which one he wants to use; maybe he wants to use all of them. That would require a change to my code. So I assumed the simplest scenario. Same with your second point, I was assuming simple lines of text with a newline only at the end.

    TheEnigma