Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners > Re: comparing k...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 8 of 11 Topic 11027 of 11531
Post > Topic >>

Re: comparing kit names

by noreply@[EMAIL PROTECTED] (Gunnar Hjalmarsson) May 7, 2008 at 10:08 PM

John W. Krahn wrote:
> Gunnar Hjalmarsson wrote:
>> perl_learner wrote:
>>> On May 6, 10:08 am, nore...@[EMAIL PROTECTED]
 (Gunnar Hjalmarsson) wrote:
>>>>
>>>>      my @[EMAIL PROTECTED]
 = split ' ', $KIT_LIST;
>>>
>>> Also with little change, "my @[EMAIL PROTECTED]
 = split '  ', $KIT_LIST; ## added
>>> an extra space to split"
>>>
>>> I am getting the desired output.
>>
>> The extra space should not make a difference, since split(' ') is a 
>> special case that splits on all kinds of whitespace.
> 
> The extra space *does* make a difference:
> 
> $ perl -le'$_ = qq[abc\t \t \t\tdef]; print ">$_<" for split q[ ]; print

> ">$_<" for split q[  ]'
>  >abc<
>  >def<
>  >abc                            def<

Ouch! I should have tested before saying that...

But then it's hard to understand that the OP gets the desired output 
with the extra space.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
 




 11 Posts in Topic:
comparing kit names
rahman77@[EMAIL PROTECTED  2008-05-05 01:10:52 
Re: comparing kit names
noreply@[EMAIL PROTECTED]  2008-05-05 12:26:04 
Re: comparing kit names
rahman77@[EMAIL PROTECTED  2008-05-05 16:34:43 
Re: comparing kit names
noreply@[EMAIL PROTECTED]  2008-05-06 19:08:14 
Re: comparing kit names
rahman77@[EMAIL PROTECTED  2008-05-06 22:07:06 
Re: comparing kit names
noreply@[EMAIL PROTECTED]  2008-05-07 13:55:08 
Re: comparing kit names
krahnj@[EMAIL PROTECTED]   2008-05-07 09:01:54 
Re: comparing kit names
noreply@[EMAIL PROTECTED]  2008-05-07 22:08:39 
Re: comparing kit names
rahman77@[EMAIL PROTECTED  2008-05-07 08:30:23 
Re: comparing kit names
noreply@[EMAIL PROTECTED]  2008-05-08 18:09:45 
Re: comparing kit names
rahman77@[EMAIL PROTECTED  2008-05-09 10:48:29 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 1:03:54 CDT 2008.