Thread in array suchen (4 answers)
Opened by Strazke at 2005-08-26 01:41

esskar
 2005-08-26 04:57
#57386 #57386
User since
2003-08-04
7321 Artikel
ModeratorIn

user image
oder wieder als hash anstatt als array...

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use strict;
use warnings;

my %websites = (
"http://www.perl-community.de" => 1,
"http://www.microsoft.de" => 1,
"http://www.perlmonks.org" => 1,
);

my $site1 = "http://www.perl-community.de";
my $site2 = "http://www.perl.de";

print "$site1: " . (exists $websites{$site1} ? "okay" : "forbidden") . "\n";
print "$site2: " . (exists $websites{$site2} ? "okay" : "forbidden") . "\n";

View full thread in array suchen