in reply to question regarding perl mechanize module

Have you tried this?

As an aside, it's worth adding use warnings as a general rule...

I hope that helps.