既然能传数组,又何苦强迫症呢……
test.pl:
use strict;
use warnings;
use Data::Dumper;
my $hash_ref = {
'4' => 'd',
'1' => 'a',
'3' => 'c',
'2' => 'b',
};
print "here is test.pl...\n";
print Dumper($hash_ref);
my @array = %$hash_ref;
my $args = join " ", @array;
print $args . "\n";
my $cmd = "perl try.pl $args";
system ("$cmd")
try.pl:
use strict;
use warnings;
use Data::Dumper;
my %rec = @ARGV;
print "\n\nhere is try.pl...\n";
print Dumper (\%rec);