> > I tried > > @ans = split (/\r/s, $msg); > @ans = split (/\r/g, $msg); > @ans = split (/\r\n/s, $msg); > @ans = split (/\r\n/g, $msg);
I think, if you are using \r and \n, it has to appear in this order "\n\r". Also, unless I misunderstand your question, this works for me (on Windows): use strict; use warnings; my $msg = 'this is line one this is line 2 this is line III'; print "original string:\n$msg\n\n"; print "the array:\n"; my @ans = split /\n\r/, $msg; print "$_\n" foreach (@ans); It also works with just the "\n". Barry Brevik _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs