Re: HoA building



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);
.