in reply to Arrays and Push
Well, for one thing,
$main::a = [0.25]; push @{main::hd}, [@main::a];
You never define an array @main::a (only an array ref $main::a), so that's going to push nothing. All the explicit packages make it a little harder to read, too.
And if you fix it to $main::a, it'll be pushing a ref to an array with one element, which element is an array ref, which isn't what you want either. You're kinda shotgunning syntax at the problem. What you probably want is something much simpler like
@hd = ( [] ); $a = [0.25] $b = [0.25, 0.5]; push @hd, $a; push @hd, $b;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Arrays and Push
by boftx (Deacon) on Apr 03, 2014 at 05:28 UTC | |
by fullermd (Priest) on Apr 03, 2014 at 07:21 UTC |
In Section
Seekers of Perl Wisdom