James Bond
04-26-2001, 12:57 AM
Hi.
I have found 3 ways to execute system commands using perl as a cgi.
#1 qx{ "<command>" }
This works, but, I can't do something like "finger user" or "ls -l" I am limited to finger or ls. Is this true or am I doing something wrong
#2 system ("command", "arg", ...)
How do I correctly use this command, I can never get any output when used in a cgi. Also, do I need to store this in an array (@ar = system(...) ) or, can I use a string like variable ( $var = system(...) )
#3 exec
How do I use this command
Also, which of these 3 is generally considered the 'best' under the most situations.
Thanks
-JB
I have found 3 ways to execute system commands using perl as a cgi.
#1 qx{ "<command>" }
This works, but, I can't do something like "finger user" or "ls -l" I am limited to finger or ls. Is this true or am I doing something wrong
#2 system ("command", "arg", ...)
How do I correctly use this command, I can never get any output when used in a cgi. Also, do I need to store this in an array (@ar = system(...) ) or, can I use a string like variable ( $var = system(...) )
#3 exec
How do I use this command
Also, which of these 3 is generally considered the 'best' under the most situations.
Thanks
-JB