in reply to Howto fill in username and password in a popup cookie with Perl

Try swapping two lines:
$mech->credentials($username,$pwd); $mech->get($addr);

So you $mech object has the credentials before retrieving the page.

update: s/options/object/. silly mistake..

--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}

Replies are listed 'Best First'.
Re^2: Howto fill in username and password in a popup cookie with Perl
by monkfan (Curate) on Sep 22, 2006 at 14:24 UTC
    shmem, thanks for the reply.

    But the code still fail to login (i.e same old output) after swapping those two lines as you suggested.

    Regards,
    Edward