in reply to Re: How to put special characters($, @, #) into a field name?
in thread How to put special characters($, @, #) into a field name?

I tried to use $mech->field(ab\$cd => $value) but it didn't work. How should I proceed now? Thanks.
  • Comment on Re^2: How to put special characters($, @, #) into a field name?

Replies are listed 'Best First'.
Re^3: How to put special characters($, @, #) into a field name?
by Fletch (Bishop) on May 26, 2007 at 22:06 UTC

    The left hand side of the fat comma (=>) only works its quote-like magic on a single sequence of word characters; "$" isn't a word character (see \w in perlre) so you have to quote it just like you would any other string. $mech->field( 'ab$cd' => $value )

Re^3: How to put special characters($, @, #) into a field name?
by shmem (Chancellor) on May 26, 2007 at 22:07 UTC
    Try
    $mech->field( 'ab$cd' => $value);

    Use single quotes for literals.

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
      Thank you guys so much! I tried to search it on the web for several hours and didn't find any answer. I got it here so quickly! I really appreciate your help! --neverminda