in reply to cgi script error
$name = system "useradd $input";
perldoc -f system tells us that "The return value [of system] is the exit status of the program".
You want to check that with something like 0 == system @command_and_args or die "system didn't do it for me: $?" ( using the 0== so as to get something false when system returns a non-zero exit code allowing the use of use or die that folks are used to)
Also, some general complaining about style. All the prints in your first script (that generate the html form) would look less "smelly" if you were to use a heredoc or other quotelike or just a plain html file instead of a perl script.
I like your use of print $cgi->header(); in the second script, too.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: cgi script error
by adam_blackice (Acolyte) on Apr 09, 2007 at 03:28 UTC | |
by f00li5h (Chaplain) on Apr 09, 2007 at 03:53 UTC | |
by adam_blackice (Acolyte) on Apr 09, 2007 at 18:01 UTC | |
by f00li5h (Chaplain) on Apr 10, 2007 at 01:21 UTC |