Forgot about leading whitespace... Assuming we don't do that... there really is no diff. Thanx for clearing that up, but I still think it's confusing. From the perlfunc pages: As a special case, specifying a PATTERN of space (' ') will split on white space just as split with no arguments does. Thus, split(' ') can be used to emulate awk's default behavior, whereas split(/ /) will give you as many null initial fields as there are leading spaces. A split on /\s+/ is like a split(' ') except that any leading whitespace produces a null first field. A split with no arguments really does a split(' ', $_) internally. > -----Original Message----- > From: John W. Krahn [mailto:krahnj@acm.org] > Sent: Tuesday, April 02, 2002 3:54 PM > To: beginners@perl.org > Subject: Re: Creating variables of a string > > > Nikola Janceski wrote: > > > > That always confused me, by default split splits by /\s+/ > so why confuse us > > more by making " " and ' ' magical. > > No, the default is NOT /\s+/, the following are all equivalent: > > @words = split; > @words = split ' '; > @words = split ' ', $_; > > > John > -- > use Perl; > program > fulfillment > > -- > To unsubscribe, e-mail: beginners-unsubscribe@perl.org > For additional commands, e-mail: beginners-help@perl.org > ---------------------------------------------------------------------------- -------------------- The views and opinions expressed in this email message are the sender's own, and do not necessarily represent the views and opinions of Summit Systems Inc.Thread Previous | Thread Next