and the output is:#!/usr/bin/perl use warnings; use strict; use Data::Dumper; my @data=({}); my %work_request = ( "DR"=>[0,0,0,0,0], "SAT ITAMS"=>[0,0,0,0,0], "PROD ITAMS"=>[0,0,0,0,0] ); #push @data, [ %work_request ]; push @data, \%work_request; $work_request{DR} = [1,2,3,4]; #push @data, [ %work_request ]; push @data, \%work_request; print Dumper( @data );
C:\Code>perl how_many_indirects.pl $VAR1 = {}; $VAR2 = { 'PROD ITAMS' => [ 0, 0, 0, 0, 0 ], 'SAT ITAMS' => [ 0, 0, 0, 0, 0 ], 'DR' => [ 1, 2, 3, 4 ] }; $VAR3 = $VAR2;
and the output is:#!/usr/bin/perl use warnings; use strict; use Data::Dumper; my @data=({}); my %work_request = ( "DR"=>[0,0,0,0,0], "SAT ITAMS"=>[0,0,0,0,0], "PROD ITAMS"=>[0,0,0,0,0] ); push @data, [ %work_request ]; #push @data, \%work_request; $work_request{DR} = [1,2,3,4]; push @data, [ %work_request ]; #push @data, \%work_request; print Dumper( @data );
C:\Code>perl how_many_indirects.pl $VAR1 = {}; $VAR2 = [ 'PROD ITAMS', [ 0, 0, 0, 0, 0 ], 'SAT ITAMS', [ 0, 0, 0, 0, 0 ], 'DR', [ 0, 0, 0, 0, 0 ] ]; $VAR3 = [ 'PROD ITAMS', $VAR2->[1], 'SAT ITAMS', $VAR2->[3], 'DR', [ 1, 2, 3, 4 ] ]; C:\Code>
In reply to Re: Array of dynamic Hash how to preserve the values
by dwm042
in thread Array of dynamic Hash how to preserve the values
by ckandreou
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |