#!/usr/bin/perl use strict; use warnings; my %blah1 = (); $blah1{condition} = ""; $blah1{terms} = [ "foobar" ]; my %blah2 = (); $blah2{condition} = "AND"; $blah2{terms} = [ "foo", "OR bar" ]; my %tests = (); $tests{1} = %blah1; $tests{2} = %blah2; print "Results from a straight hash:\n"; &makef(%blah2); print "Results from a hash within a hash:\n"; &makef(%{$tests{2}}); sub makef { my (%farticle) = @_; foreach my $blah (@{$farticle{terms}}) { print "$blah\n"; } } exit;
In reply to hash with a hash by rsiedl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |