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";