Barry Brevik wrote: > I can't believe this has me stymied, but here goes... > > I'm processing a string of chars in a loop, and the string can contain > multiple lines; that is, the string has embedded "\n" chars in it. For > display purposes, I need to count the number of "\n" chars in each > string. Is there a simple way to do this? > >
scalar(split(/\n/, $string)) - 1 ...does that work for you? _______________________________________________ ActivePerl mailing list ActivePerl@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs