in reply to hash with a hash
++ for using strict and warnings. Read Perl Data Structures Cookbook for more on hashes of hashes.$ 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; use Data::Dumper; print Dumper(\%tests); __END__ $VAR1 = { '1' => '2/8', '2' => '2/8' };
|
|---|