W
wana
suppose you have this:
@array1 = ();
@array2 = ();
@array3 = ();
$count = 0;
foreach(@array1)
{
if (count % 100 == 0)
{
#the code in question:
push @array3, \@array2;
@array2 = ();
}
push @array2, $_;
count++;
}
I don't think this will work as expected because what I really want is
to create an anonymous array from @array2 and push a reference to that
onto @array3.
Or at least I think that's the way to do it but I'm not sure how to
create an anonymous array from the contents of another array.
Thanks!
wana
@array1 = ();
@array2 = ();
@array3 = ();
$count = 0;
foreach(@array1)
{
if (count % 100 == 0)
{
#the code in question:
push @array3, \@array2;
@array2 = ();
}
push @array2, $_;
count++;
}
I don't think this will work as expected because what I really want is
to create an anonymous array from @array2 and push a reference to that
onto @array3.
Or at least I think that's the way to do it but I'm not sure how to
create an anonymous array from the contents of another array.
Thanks!
wana