Perl: Meaning of double squared brackets after a string?

It means you’re working with a two dimensional array.

#!/usr/bin/env perl

use strict;
use warnings;

my @stuff = ( 
   [ 1, 2, 3, 4 ],
   [ 5, 6, 7, 8 ],
 );

 print $stuff[1][2]; 
 #prints '7'

Leave a Comment