"christrier" <> wrote:
> I am sorry, but I am quite a Newbie to Perl and I don't really get what
> you mean!
I only included code. I didn't "mean" anything by it, it was just code!
> > my (undef,undef,undef,undef,undef,@pairs)=split/;/, $line;
> what exactly does this line do? I think it reads the first five
> statements into the undef-variable and then it reads the rest into the
> @pairs-array - if i am wrong please correct me!
Well, undef isn't a variable, it is just a place holder. And split doesn't
return statements, it returns strings. Statements are code, strings are
data.
> Why do you use 5 undef-variables?
Because your data lines start with 5 fields that are not interesting.
>
> > die "Odd number!" if @pairs%2;
>
> > while (my ($k,$v)=splice @pairs,0,2) {
> > push @{$some_hash{$k}},$v;
> > };
> >
> this loop reads from position 0 to position 2
It is a length of 2 starting from 0, so that means position 0 to
position *1*. And I wouldn't call it "reading", but rather "assigning".
> and writes everything
> into the hash and "deletes entry 0 and 1 - so you can repeat the same
> operation until the array is empty?
Pretty much, yes.
Xho
--
--------------------
http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB