clean way to make array a 2d array Looking for a cleaner (possibly one liner) way to write the following

my $spec_2d = ( );
foreach ( @spec ) {
  $spec_2d[$_][0] = $spec[$_];
}
@spec = @spec_2d;


Basically I'm making an array an array of arrays
@spec_2d[@spec] = map [ $spec[$_] ], @spec;


but judging from the subject I think you want this,

my @spec_2d = map [ $_ ], @spec;