Hi everyone

This is my first posting to the list, although I've been burried knee deep in
perl books for some time and have been doing web development in other languages
for some time.

I'm working with Mod_perl on Apache on Linux.

I have a simple question (I think ;)

I keep seeing pattern matches like this:

while ($line = <>) {
    if ($line =~ /$pattern/o) {
        # do something
    }
} 

It's almost exactly what I want to do. I want to see if a line starts with a
pattern and if doesn't do something, so I would use unless instead of if.

However the file I want to run this on is actually in a variable not a file.
Normal line endings of \n.

how would I do a while on a variable?

Thanks so much, and if I can help anyone I will. I know regex fairly well.

Cheers

Angie

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to