I can not seem to get the following script to return the correct response. Could someone point where I am off. Thx, Dave Gilden (kora musician / audiophile / webmaster @ www.coraconnection.com / Ft. Worth, TX, USA)
#!/usr/bin/perl use CGI qw/:standard/; use CGI::Carp qw(fatalsToBrowser); use POSIX 'strftime'; use strict; my $approvedUser ='10_xyz'; my $whitelist = "amya_whitelist.txt"; ## White List .....: ## nick, mailRouting # "10xxx","10_xyz" # "dave","dave_office" # etc..... ##### my %hash; open EL, $whitelist or &errorMessage( "$!: Read in Error: Could not find $whitelist" ); my @lines = <EL>; close(EL); foreach(@lines){ chomp; next if /^#/; my ($key,$val) = split ','; $hash{$key} = $val; } # debug # foreach my $k (keys %hash){ # print "$hash{$k}\n"; # } if(!defined $hash{$approvedUser} ) { &errorMessage( "your not an authorized user") } else { print "$approvedUser is cool\n"; } sub errorMessage { my $msg = shift || ''; print "$msg\n"; exit; } __END__ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>