Thread Frage zu Hash::Util (11 answers)
Opened by Crian at 2005-02-17 16:42

esskar
 2005-02-17 17:15
#51862 #51862
User since
2003-08-04
7321 Artikel
ModeratorIn

user image
[quote=renee,17.02.2005, 16:04]Vielleicht hilft Dir http://wiki.perl-community.de/bin....raenken weiter...[/quote]
geht wohl

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use strict;
use Hash::Util qw(lock_keys);

my %hash = ();

$hash{Erlaubt} = 1;
$hash{Test} = 1;
$hash{Auch_erlaubt} = 1;

lock_keys(%hash);

sub foo {
my $h = shift;
$h->{uhu} = 1;
}

foo(\%hash);

-> "Attempt to access disallowed key 'uhu' in a restricted hash at - line 14."

View full thread Frage zu Hash::Util