in reply to Re^3: Push array into array of arrays
in thread Push array into array of arrays

how can i ensure it to be inserted, without overriding the previous ?

Copy @jumpjump to a new anonymous array and insert its reference into @data.

#!/usr/bin/perl5.14.1 use strict; use warnings; use Data::Dumper; my @tesxt = ('perl','python','pearl', 'pear', 'pink', 'pong'); my @jumpjump = ($tesxt[0], $tesxt[2], $tesxt[3], 'kit','kat',7); my @data = (); push @data, \@tesxt; push @data, [@jumpjump]; splice (@jumpjump); @jumpjump = ($tesxt[0], $tesxt[2], $tesxt[3], 'koo','kaa',7); push @data, [@jumpjump]; print Dumper \@data;
poj

Replies are listed 'Best First'.
Re^5: Push array into array of arrays
by Anonymous Monk on Dec 20, 2018 at 09:37 UTC
    omg wow @poj ! thank you very much !! how amazing this anonymous array solved my 2-day-old issue ! amazing square brackets ! thanks ! It works !