in reply to question about regex and using a scalar variable to store/call it

You're mixing up the regexp matching operator (//) with the regular expression itself

So your first test needs to become
$document="report.html\?"; ... if(/$document/){
and similarly for the others.

Oop. The comparison to $apache_log on the next line is wrong: you've missed out a ~, so you're using straight assignment

  • Comment on Re: question about regex and using a scalar variable to store/call it
  • Download Code