note
Not_a_Number
<p><b>1) </b>This statement:</p>
<blockquote><i>If you leave off the pattern, split assumes you want to split on /\s+/.</i></blockquote>
<p>needs considerable qualification. You can't just 'leave off the pattern' except in one particular circumstance. Try this:</p>
<code>my $str = " foo bar baz ";
my @spl = split $str;
print "@spl";</code>
<p>It just doesn't work (at least in 5.6.1). You can only leave off the 'pattern' if you also leave off the 'target', ie if you are splitting on an implicit $_, eg:</p>
<code>while ( <DATA> ) {
split;
#do something interesting;
}</code>
<strike><p><b>2) </b>This is plain wrong:<p>
<blockquote><i>One special case is when you specify the string literal, " " (a quoted space), which does the same thing as specifying no delimiter at all (no argument).</i></blockquote>
<p>There is nothing special about <code>" "</code> (see gmax's example above). You are confusing it with <code>' '</code>.</p></strike>
<p><b>3) </b>One other minor point, I would suggest bringing the paragraph <b>Preserving delimiters</b> up to just below <b>Where do delimiters go?</b>, which IMHO would be a more logical ordering.</p>
<p>hth</p>
<p>dave</p>
<p><b>Update:</b> See Abigail-II's post below</p>
287544
287544