Re: HoA building



"M. Lewis" wrote:
John W. Krahn wrote:
M. Lewis wrote:
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?

similar, but not the same.

perldoc -f split (>>) said, in part,
>> A "split" on "/\s+/" is like a "split(' ')"
>> except that any leading whitespace
>> produces a null first field.

-jp

.