Re: comparing kit names

[email protected] (perl_learner)
Newsgroups perl.beginners
Organization http://groups.google.com
Message-ID <[email protected]>
On May 7, 4:55 am, [email protected] (Gunnar Hjalmarsson) wrote:
> perl_learner wrote:
> > On May 6, 10:08 am, [email protected] (Gunnar Hjalmarsson) wrote:
> >> perl_learner wrote:
>
> >>> my @kits = $KIT_LIST;
>
> >> How many elements do you think there are in @kits?
>
> > I have ~100 elements @kits. Why did you ask this question?
>
> Because when you just said
>
>      my @kits = $KIT_LIST;
>
> you had only one element in @kits.
>
> >>      my @kits = split ' ', $KIT_LIST;
>
> > Also with little change, "my @kits = 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.
>
>      perldoc -f split
>
> --
> Gunnar Hjalmarsson
> Email:http://www.gunnar.cc/cgi-bin/contact.pl

> >>      my @kits = split '  ', $KIT_LIST;

The extra space had make a difference.....
Without extra space I was getting:

a a a . t . z a a a _ d . t . z b b b . t . z b b b _ d . t . z c c
c . t . z c c c _ d . t . z d d d . t . z e e e . t . z

With extra space I get the correct output: aaa.t.z aaa_d.t.z bbb.t.z
bbb_d.t.z ccc.t.z ccc_d.t.z ddd.t.z eee.t.z

Thanks!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.