On Jan 31, Nikola Janceski said: >you want to treat $text as a single string >use >$text =~ s/\n+/\n/sg; # use /mg if you want to treat the string as multiple >lines.
Your information about /s and /m is wrong. /s changes how . matches, and there is no . in your regex. /m changes how ^ and $ work, and there are no ^ or $ in your regex. $text =~ s/\n+/\n/g; is fine, as is: $text =~ s/\n\n+/\n/g; as is: $text =~ tr/\n//s; -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ ** Look for "Regular Expressions in Perl" published by Manning, in 2002 ** <stu> what does y/// stand for? <tenderpuss> why, yansliterate of course. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]