http://www.perlmonks.org?node_id=570902


in reply to Use of a global scalar

our $text =~ s/$data[0]/$data[2]/g;
You should note that $data[0] is interpreted as a regular expression, which is probably not what you want. This common error is often the cause of vulnerabilities. See "DON'T" in perlcheat and "\Q" in perlre.

Replies are listed 'Best First'.
Re^2: Use of a global scalar
by Grey Fox (Chaplain) on Sep 03, 2006 at 05:28 UTC
    Thank you much;
    It took me a little while to figure out that the regex was using the address instead of the value. I knew it wasn't working but didn't know why. Now I know where to look.
    Thanks, again.

    -- Grey Fox
    Perl - Hours to learn lifetime to master.