Lightning flashed, thunder crashed and "Kyrytow, Stefan" <[EMAIL PROTECTED]
m> whispered:
| Example.
| I am writing a script to parse a web log and report on all the hosts in the
| log.
| However I have a command line option to exclude a domain from the report.
| My problem is that I can't figure out how to use the inputed value in a
| regexp.
| 
| Log Format
| host.domain.com
| 
| I want to be able to exclude domain.com
| 
| I have tried:
| while( $exclude_domain !~ /$host/ ) { ... }

Without a better explanation of your exact problem, I think you have this
backwards from what you really want.  Try

while ($host !~ /$exclude_domain/) { ... }

In other words, if the hostname doesn't contain the excluded domain do
whatever.

-spp

Reply via email to