#!/usr/bin/perl -w use strict; my %table; for my $i (1..10) { $table{$i} = { shape => $i % 2 ? 'circle' : 'rect', coords => [0,1,2,3,4,5,6,7,8,9] } } foreach my $key (keys %table) { print "Key $key Value $table{$key}\n", "Shape $table{$key}{shape}\n", join(",", @{$table{$key}{coords}}[0,3]), "\n"; }
In reply to Re: Correct syntax to access an array slice within a hash within a hash
by snowcrash
in thread Correct syntax to access an array slice within a hash within a hash
by Popcorn Dave
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |