mayanksri1989 has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to pass a string $t containing % , / , > and some alphanumeric characters to a subroutine of WWW::Mechanize

 $mech->field("myValue", $t);

I get an error: "Error POSTing -NameOfURL- : Internal Server Error"

Please help!

Sample string to pass: MA%an34/S>t3
  • Comment on Passing a string containing % , / , > to a method of WWW::Mechanize is causing issues
  • Download Code

Replies are listed 'Best First'.
Re: Passing a string containing % , / , > to a method of WWW::Mechanize is causing issues
by Corion (Patriarch) on Apr 20, 2016 at 14:35 UTC

    "Internal Server Error" means that the receiving end did not handle the data you passed in well. You will have to talk to the server administrator and the programmer of the server how to fix their problem.

Re: Passing a string containing % , / , > to a method of WWW::Mechanize is causing issues
by Laurent_R (Canon) on Apr 20, 2016 at 16:06 UTC
    What you are passing is not clear to me. Are you passing the literal string "MA%an34/S>t3" or are you passing a variable containing that string? Please show a verbatim sample of this part of the code.
      I am passing $t to the function field of Mechanize, $t has the following value -> "MA%an34/S>t3"
        Alright, thanks for your answer. It may sound obvious, but just in case, did you try to print $t to ascertain its content?
Re: Passing a string containing % , / , > to a method of WWW::Mechanize is causing issues
by GotToBTru (Prior) on Apr 20, 2016 at 19:17 UTC

    Please take the time to post a short, self-contained, correct example that demonstrates your problem. Yeah, that takes some effort. But you will find that making that effort will often reveal your error without having to wait for an answer! And if it doesn't, you make it 200% easier for us to help you. You will get more and better answers.

    But God demonstrates His own love toward us, in that while we were yet sinners, Christ died for us. Romans 5:8 (NASB)