Re: HoA building
- From: perrin@xxxxxxxxxxxx (Chad Perrin)
- Date: Wed, 27 Dec 2006 22:58:40 -0700
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);
.
- Follow-Ups:
- Re: HoA building
- From: Chad Perrin
- Re: HoA building
- From: Uri Guttman
- Re: HoA building
- References:
- HoA building
- From: "M. Lewis"
- Re: HoA building
- From: John W. Krahn
- Re: HoA building
- From: "M. Lewis"
- HoA building
- Prev by Date: Re: HoA building
- Next by Date: Re: HoA building
- Previous by thread: Re: HoA building
- Next by thread: Re: HoA building
- Index(es):