in reply to Can't call method "click" on an undefined value

Note that the error is origination from within WWW::Mechanize. It's not $mech that's undefined. WWW::Mechanize::click in turns calls the method click of another object.

The problem is that WWW::Mechanize doesn't find the button you want it to find but proceeds to try to click it anyway. According to the docs,

The first argument is the name of the button to be clicked

The document doesn't contain any buttons named Save/Reboot. You'd be better off using a method that can locate a button by value, such as click_button.

$mech->click_button( value => $button );

Replies are listed 'Best First'.
Re^2: Can't call method "click" on an undefined value
by Anonymous Monk on Jun 01, 2008 at 04:08 UTC
    Actually, its because he hasn't selected a form (form_name form_number), and since there are no forms on the page