Perl/Shell Knowledge Sharing
Perl Interview Questions and Answers
Thursday, February 17, 2011
How do I create a 2D array in Perl
my @array = ([1, 2, 3], [4, 5, 6], [7, 8, 9]);
my $top_left = $array[0][0]; # 1
my $bottom_right = $array[2][2]; # 9
print "@$_\n" for @array;
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment