Here's three ways to pass hash data from a sub.use strict; use warnings; my %hash1 = %{create()}; my $ref = create(); my %hash2; give(\%hash2); print $hash1{'a'} . $ref->{'b'} . $hash2{'c'}; sub create { my %hash = ('a' => '1', 'b' => '2'); return \%hash; } sub give { my $ref = shift; %$ref = ('c' => '3', 'd' => '4'); }
In reply to Re: class object and hash
by TedPride
in thread class object and hash
by bengmau
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |