in reply to dumb split question

my @lines = split "\n", $text; is right. Note"\n" and /\n/ are the same. It WILL be splitting on the newlines (only) If it is splitting where you don't want it to then you have extra newlines which you just THINK are whitespace. You might get this misconception if this is say CGI related as in HTML all 'whitespace' ie \t \n ' ' gets rendered as a single space.
my $text = "foo 1\t2 3\nbar 1\t2 3\nbaz 1\t2 3"; my @lines = split "\n", $text; print join '|', @lines; # lets see what $text actually contains by displaying # non word digit space chars a (\octal) tokens $text =~ s/([^\w\d ])/sprintf "(\\%03o)", ord $1/ge; print "\n\nActual text:\n", $text; __DATA__ foo 1 2 3|bar 1 2 3|baz 1 2 3 Actual text: foo 1(\011)2 3(\012)bar 1(\011)2 3(\012)baz 1(\011)2 3

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print