in reply to Split and empty strings
Update: I just tried this code, and it works as I expect.
The output for my Perl 5.6.1 system is:$_ = "one two three four "; foreach my $line (split(/\n/)) { print "$line\n"; }
$ perl ~/split.pl one two three fourwith the blank printed between three and four, and nothing thereafter.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Split and empty strings
by andye (Curate) on Apr 10, 2001 at 19:29 UTC |