如何在perl子函数中传递参数

2024-11-11 18:01:00
推荐回答(1个)
回答1:

sub test { my %hash = @_; print "$_ => $hash{$_}$/" foreach keys %hash;}my %h = ( A => 100, B => 200, C => 300 );test(%h);