Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
test(\%myHash) ;
sub test
{
my $hashRef = shift ;
my $hashDeRef = %$hashRef ;
}
test(%hash);
sub test{
%values = @_;
}
KevinADC said:but only if the hash has all it's key/value pairs defind.
%hash = (
blah => test,
foo => ,
bar => test,
);
test(%hash);
sub test {
my %hash = @_;
print "$_ = $hash{$_}\n" for keys %hash;
}
output:
blah = test
test =
foo = bar
KevinADC said:Well, unless this behavior is OK it's not a problem
%hash = (
blah => 'blahval',
foo => ,
bar => 'barval',
);
print "$_ = $hash{$_}\n" for keys %hash;
output:
blah = blahval
barval =
foo = bar
%hash = (
blah => 'blahval',
foo => undef,
bar => 'barval',
);
test(%hash);
sub test {
my %hash = @_;
print "$_ = $hash{$_}\n" for keys %hash;
}
output:
blah = blahval
bar = barval
foo =
@a = (1,,2,3,,,4,5);
# Equals (1,2,3,4,5);
@a = (1),(),(2,3),(),(),(4,5);
# More obviously equals (1,2,3,4,5);
# Or easier to see.
@a = (1);
@empty = ();
@b = (2,3);
@c = (4,5);
@group = (@a,@empty,@b,@empty,@empty,@c);
# Equals (1,2,3,4,5);