- or download this
my $struct = {
hashRef => { fruit => 'apple', veggie => 'corn' },
arrayRef => [ qw(1 2 3 4 5) ],
};
- or download this
#!/usr/bin/env perl5
use strict;
...
# And for the coup de grace, we'll deref $struct via ${} instead of ->
# too.
print ${${$struct}{hashRef}}{fruit}, "\n";
- or download this
% ./tst.pl
apple
apple
apple
apple