S
sam
Hi group,
The following code only return a single hash:
#!/usr/bin/perl -w
use strict;
use warnings;
use Data:umper;
sub construct
{
my %values = ();
my %valuesB = ();
my $sales_total = 200;
my $sales_totalB = 400;
$values{'sales_calc_total'} = ($sales_total);
$valuesB{'sales_calc_total'} = ($sales_totalB);
return (%values, %valuesB);
}
my(%hashh, %hashhB) = construct;
print Dumper(%hashh);
print "\n";
print Dumper(%hashhB);
print "sales: $hashh{'sales_calc_total'}\n";
Result:
# !perl
perl test5.pl
$VAR1 = 'sales_calc_total';
$VAR2 = 400;
sales: 400
But where is hashh?
I've been scratching my head for whole day but couldn't found a way to
fix it. It does look simple, but it turns out killing me completely.
Thanks
The following code only return a single hash:
#!/usr/bin/perl -w
use strict;
use warnings;
use Data:umper;
sub construct
{
my %values = ();
my %valuesB = ();
my $sales_total = 200;
my $sales_totalB = 400;
$values{'sales_calc_total'} = ($sales_total);
$valuesB{'sales_calc_total'} = ($sales_totalB);
return (%values, %valuesB);
}
my(%hashh, %hashhB) = construct;
print Dumper(%hashh);
print "\n";
print Dumper(%hashhB);
print "sales: $hashh{'sales_calc_total'}\n";
Result:
# !perl
perl test5.pl
$VAR1 = 'sales_calc_total';
$VAR2 = 400;
sales: 400
But where is hashh?
I've been scratching my head for whole day but couldn't found a way to
fix it. It does look simple, but it turns out killing me completely.
Thanks