E
Edo
Hello
I am having hard time with these compex data structure although I have
been doing lots of reading, but with out doing it my self I will not
learn it. so after few hours last night and today, I gave up.
I have a file
a A
b B
c C
d D
I need to create array like this
@array = (a [A B C D]);
this is puting out
Can't use string ("a") as an ARRAY ref while "strict refs" in use ...
while (<FH>) {
$. == 1 ?
push @array, (split //)[0] :
push @{ $array[0]}, (split //)[1];
}
thanks
I am having hard time with these compex data structure although I have
been doing lots of reading, but with out doing it my self I will not
learn it. so after few hours last night and today, I gave up.
I have a file
a A
b B
c C
d D
I need to create array like this
@array = (a [A B C D]);
this is puting out
Can't use string ("a") as an ARRAY ref while "strict refs" in use ...
while (<FH>) {
$. == 1 ?
push @array, (split //)[0] :
push @{ $array[0]}, (split //)[1];
}
thanks