my @GOODLIST = qw(10.0.1.5 10.0.2.1); use CGI qw(:all); use strict; for my $remote_addr (remote_addr()) { if (grep $remote_addr, @GOODLIST) { print redirect ("/secret/URL/here/foo.thingy"); } else { print header ( status => 404 ), start_html( 'error' ), "The resource you tried to access is not found", end_html; } }