1 2 3 4 5 6 7 8 9 10 11 12 13
#!/usr/bin/perl use warnings; use diagnostics; my %var = (foo=>"bar"); sub print_foo { my $ref = shift; print %{$ref}->{foo}; } print_foo \%var;
1
2
3
4
5
6
7
8
$ perl /tmp/unbenannt
Using a hash as a reference is deprecated at /tmp/unbenannt line 10 (#1)
(D deprecated) You tried to use a hash as a reference, as in
%foo->{"bar"} or %$ref->{"hello"}. Versions of perl <= 5.6.1
used to allow this syntax, but shouldn't have. It is now deprecated, and will
be removed in a future version.
bar
Quoteprint "Bedeutung von XML: $Sprachenzeiger->{XML} <br>\n";
2012-11-03T14:42:37 mikaHatte den Text auch nur überflogen, weil mir die Syntax entfallen war...
Quote(D deprecated) You tried to use a hash as a reference, as in
%foo->{"bar"} or %$ref->{"hello"}. Versions of perl <= 5.6.1
used to allow this syntax, but shouldn't have. It is now deprecated, and will
be removed in a future version.
1 2 3 4 5 6 7
my %t = (a => 1); sub la { my $t = shift; my %t = %$t; print $t{'a'}; } la \%t;
my %t = %$t;