my %default_values = ( 'int' => '0', 'float' => '0.0', 'bool' => 'false' ); # Oooog: my %structs = ( 'struct_name' => [ [ 'float', 'one', '0.0' ], [ 'float', 'two', '0.0' ], [ 'int', 'three', '0' ], [ 'bool', 'potato', 'false' ] ] ); # more stuff here, then when I am checking the variable type: if (exists $default_values{$type}) { print $output " verify(\"$short_var = $default_values{$type}\",\n"; print $output " $variable"."[i],\n"; print $output " ($type)$default_values{$type});\n"; } elsif (exists $structs{$type}) { my $array_ref = $structs{$type}; foreach my $object_ref (@{$array_ref}) { print $output " verify(\"$short_var.@{$object_ref}[1] = @{$object_ref}[2]\",\n"; print $output " $variable.@{$object_ref}[1],\n"; print $output " (@{$object_ref}[0])@{$object_ref}[2]);\n"; } }