in reply to If Simplification

untested 8)

if (tester()){ } sub tester{ return unless $ENV{'HTTP_REFERER'}; return if $ENV{'REMOTE_ADDR'} eq "129.215.67.96"; return 1 if ( ($ENV{'REQUEST_URI'} =~ /FalseIfJustThis/) && ($ENV{'R +EQUEST_URI'} =~ /ButIfAlsoThisThenTrue/) ); return if $ENV{'REQUEST_URI'} =~ /FalseIfJustThis/; my @bad = ( '/bulletin/', '.css', '.ico', 'formmail.', '/prosp/', '/calendar/', '/edit/', 'tmp/calendar2002-3/pgradh/regs/029.html', 'FalseIfJustThis', ); return if $ENV{'REQUEST_URI'} =~ /\Q$_\E/ foreach(@bad); return 1; )

Update: /\Q$_\E/ foreach(@bad); # (thanks anon)

cheers,

J

Replies are listed 'Best First'.
Re: Re: If Simplification
by Anonymous Monk on Aug 07, 2003 at 11:58 UTC
    You probably want to @bad = map quotemeta, @bad; or @bad = map {qr{$_}i} @bad;.
Re: Re: If Simplification
by fourmi (Scribe) on Aug 07, 2003 at 11:30 UTC
    Again thanks! Im going to have a play with the suggestions, and wil probably render them unrecognisable at the end, will repost what i settle with once the headache clears!!