Thread schlüssel im hash ermitteln (8 answers)
Opened by Froschpopo at 2005-04-17 19:52

Froschpopo
 2005-04-17 20:07
#53874 #53874
User since
2003-08-15
2653 Artikel
BenutzerIn
[default_avatar]
naja etwas aufwändig:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
my %hash = (
    "name" => "lucas"
);

my $res = get_key("lucas");

sub get_key {
    foreach (my ($key, $value) = each(%hash)) {
        return "$key\n" and last if $value eq $_[0];
    }
}
\n\n

<!--EDIT|Froschpopo|1113754230-->

View full thread schlüssel im hash ermitteln