Unlike other IO commands, system returns 0 on sucess, making the system() or die ... construct rather useless.
the documentation elaborates quite a bit on the correct way to check for errors. Read it (both of you :-).
Also I'd never, ever consider running the web server as root, not even for testing. A much saner approach would be to add a sudo rule that allows the www or www-data user to execute just that one command. But the whole idea seems flawed to me. Remote management systems exist.
In reply to Re^2: Simple reboot from perl?
by moritz
in thread Simple reboot from perl?
by lesnod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |