Home:ALL Converter>How to declare array with existing arrays in perl?

How to declare array with existing arrays in perl?

Ask Time:2012-09-23T04:28:00         Author:fishpen0

Json Formatter

So say I created a set of arrays like so:

my (@device, @mount, @type, @options, @dump, @pass) = ();

Then later I wanted to create an array with those arrays inside it. How would I do that? I tried to use:

my @columns = (@device, @mount, @type, @options, @dump, @pass);

and

my @columns = ([@device], [@mount], [@type], [@options], [@dump], [@pass]);

The issue seems to be that @columns remains empty. I feel like I am making a really simple syntax mistake. What have I done wrong?

Author:fishpen0,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/12547449/how-to-declare-array-with-existing-arrays-in-perl
yy