in reply to Re^3: Push array into array of arrays
in thread Push array into array of arrays
Copy @jumpjump to a new anonymous array and insert its reference into @data.
poj#!/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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Push array into array of arrays
by Anonymous Monk on Dec 20, 2018 at 09:37 UTC |