in reply to Email Address in Post Replies,

Hi dmsparts,

This looks like a "Inherited Script" scenario where you didn't create this script back in the late 90's when a functional approach to scripting in Perl was the usual method. Been there, Done that!

So, let's answer the question. The hexidecimal (ASCII) value is what you're seeing, @ = %40. So, simply use a substitution statement to correct the problem.

$email = $postFields{ "email" }; $email =~ s/(\%40)/\@/gi;
I added grouping as well as a global search and case insignificant modifiers.

Hope this helps, Good Luck

Replies are listed 'Best First'.
Re^2: Email Address in Post Replies,
by chromatic (Archbishop) on Dec 16, 2008 at 23:40 UTC

    I'm not sure this is good advice. Yes, this does seem to solve the current problem, but it makes the code a little more fragile and even less likely to be correct in the future.

      Chromatic,

      I would agree that this code in it's entirety needs to be brought up to speed as far as using hashes, packages and a more current style of scripting.

      I don't see where using substitution adds instability or has a problem with accuracy, unless they change the ASCII value for the character '@'.

      If I were the OP, and had a choice of re-writing this script, or fixing it for now and coming back to it later, I would code the fix and enjoy the Holiday's.
      Sometimes, getting all fancy for such a little straight forward script is not worth the effort.

        I don't see where using substitution adds instability or has a problem with accuracy, unless they change the ASCII value for the character '@'.

        It fixes one symptom but fails to address at least six serious bugs lurking in the hand-rolled parsing code, including the root cause of this problem.

        Sometimes, getting all fancy for such a little straight forward script is not worth the effort.

        Sometimes, shorter and simpler code is easier to maintain -- especially in this case, where this particular bug would not have been present at all. If that makes code "fancy" and that's a bad thing, so be it.