in reply to Re: Counting characters in a string
in thread Counting characters in a string

That will stop at every newline and continue again after it:
$ perl -we'$string = "abcdef\nghijk\nlmno\npqr\nst\nu"; > print map { "$_\n" } $string =~ /.{1,5}/g;' abcde f ghijk lmno pqr st u
You either want the //s flag on the match or some other way of dealing with newlines.

Replies are listed 'Best First'.
Re: Re: Re: Counting characters in a string
by valentin (Abbot) on Feb 06, 2004 at 16:15 UTC
    thanks, you are right //s is fine for me.