in reply to RE: A splitting question
in thread A splitting question
Update: Some sample code to demonstrate:
Outputs:#!/usr/bin/perl -w use strict; while (<DATA>){ for my $myword (split){ print "[$myword]\n"; } print "we have a newline now\n"; } __END__ a b c d e f g h i
It never splits on the newline (It tries, see that there are only empty elements afterward, and discards it)[a] [b] [c] we have a newline now [d] [e] [f] we have a newline now [g] [h] [i] we have a newline now
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
split and newlines in RE:{3} A splitting question
by jeroenes (Priest) on Nov 15, 2000 at 17:15 UTC | |
|
RE: RE: RE: A splitting question
by BigJoe (Curate) on Nov 15, 2000 at 03:04 UTC | |
by little (Curate) on Nov 15, 2000 at 03:11 UTC |