I had emailed this query out previously but since I
never saw my own email in the digest, I'm assuming
that it never made it to the [EMAIL PROTECTED] list.
Please forgive me if it did and I did not see it (my
SPAM filter might have eaten it).
Question #1
-----------
I have an array stored in an object and I trying to
compute the length of the array. This seemed to work
initially:
my $nColumns = [EMAIL PROTECTED]>{component_titles}}}+1;
Something changed, I don't know what, and perl started
dying on the above statement with no error message or
explanation. I had to resort to this technique:
my @ComponentTitles = @{$me->{component_titles}};
my $nColumns = $#ComponentTitles+1 ;
This seems to work, but I don't like it because it
uses a supefluous deep copy. Can someone tell me how
to do it in one statement without a superfluous deep
copy?
Question #2
-----------
Incidently, I believe I'm storing an array here
instead of a reference to an array.
I don't really do anything to create to create this
array -- I just start storing elements like this:
$me->{component_titles}[0] = "xyz";
Is there a better way to populate this array? Perhaps
with a declaration or something?
Question #3
-----------
I tried to create a second array and store it by
reference like this:
my $a = [];
$me->{a} = \$a;
$a->[0] = 1;
$a->[1] = 23;
etc...
But when I tried to retrieve the array, there was
nothing there:
print $me->{a}->[0];
I cured the problem by storing elements directly, but
I did not want to make a new copy of the array (I
wanted to store a reference to the original array).
$ii = 0;
$me->{a}->[$ii++] = $_ foreach (@{$a});
Why does not this work:
$me->{a} = \$a;
Thanks,
Siegfried
__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]