in reply to Error 404 fix

First of all, learn to use use strict;, and how to return values from your subroutines. All this global data flying around will hurt you again and again, especially without use strict;.

And my god, you are parsing the CGI stuff yourself. Big no no. Use the CGI module (see perldoc CGI).

As for your problem: why not set $url to a standard location containing your error message in findurl() before entering the loop over your data:

sub findurl { open (INFO, "$datafile"); @information = <INFO>; $url = "http://mysite/error_message.html"; foreach $information (@information) { ($title, $location) = split(/\|/ , $information); { if ($title eq $name) { $url = $location; } } } close (INFO); }

And please, Fellow Clueful Monks, do not kill me for giving an answer to a request like this.

And for you poor soul that asked this question: get a decent book on Perl programming, quick, quick, run to the next bookstore, don't walk, and buy "Learning Perl" or something similar. See Tom Christiansen's book review list for other book suggestions. No no, don't tell me you can't afford that (if that is really the case, start with perldoc perlfaq and read through the online-docs). May the spirit finally come upon you.

Christian Lemburg
Brainbench MVP for Perl
http://www.brainbench.com