in reply to Need to fill password in with perl on Javascript?
This is not going to be perl related, but why are you trying to fix a different problem? I understand monitoring a router but...man, don't just "reboot" it.
Fix the problem and then plug monitoring tools on top of it.