in reply to Re: Correct Regex for reading stock symbol?
in thread Correct Regex for reading stock symbol?

Also, $stock_symbol = $1; is useless, since you're capturing the entirety of the regexp.
Wrong. This is one way to untaint $stock_symbol. You can read more about taint checks in perlsec.
  • Comment on Re^2: Correct Regex for reading stock symbol?

Replies are listed 'Best First'.
Re^3: Correct Regex for reading stock symbol?
by ikegami (Patriarch) on Jan 31, 2006 at 19:24 UTC
    Ah yes. The OP even mentioned tainting. Taint is something I need to use more. The OP really shouldn't be using the same variable name for both the tainted and the untainted variables. Joel wrote an excellent paper on the subject. Admittedly, Joel's language didn't have built in tainting, but I recommend the technique nonetheless.