On Wed, Dec 27, 2006 at 07:42:59PM -0500, M. Lewis wrote:
> John W. Krahn wrote:
> >M. Lewis wrote:
> >>
> >>while (my $ln = <DATA>){
> >>    chomp $ln;
> >>    my ($prod, $flavor) = split /\s/, $ln, 2;
> >
> >You probably should use ' ' instead of /\s/ as the first argument to split:
> >
> >     my ($prod, $flavor) = split ' ', $ln, 2;
> 
> Ok, but why? Are they not the same?

No, they're not.  ' ' is a literal space.  /\s/ matches any whitespace.

-- 
CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ]
print substr("Just another Perl hacker", 0, -2);

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


Reply via email to