On Thu, Dec 28, 2006 at 03:31:36AM -0500, M. Lewis wrote:
> 
> Chad, I've been experimenting with this a bit since your posting. Maybe 
> this will help: (I'm trying to understand the diff too)
> 
> perl -le'
> my $ln = "one  two  three  four  ";
> print map " |$_| ", split /\s/, $ln;
> print map " |$_| ", split " ", $ln;
> '
>  |one|  ||  |two|  ||  |three|  ||  |four|
>  |one|  |two|  |three|  |four|
> 
> 
> perl -le'
> my $ln = "one  two  three  four  ";
> print map " |$_| ", split /\s+/, $ln;
> print map " |$_| ", split " ", $ln;
> '
>  |one|  |two|  |three|  |four|
>  |one|  |two|  |three|  |four|

That makes sense, considering I just checked the tutorials at PerlMonks
and discovered that, according to split(), ' ' and /\s+/ are exactly the
same.  Frankly, I find that a bit surprising.

-- 
CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ]
"The ability to quote is a serviceable
substitute for wit." - W. Somerset Maugham

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to