my $str = "1\n2\n3\n4"; my @tokens = split( /\n/, $str ); # now tokens contain # ( "1", "2", "3", "4" ), NOT ( "1\n", "2\n", "3\n", "4\n" )