You might want to try using readdir() and opendir() instead. 
Anyone using backticks in the cgi can cause security holes if
they do not use taint. Also, using backticks spawns a separate
shell, instead of running in the perl memory space.

-James




-----Original Message-----
From: Brett W. McCoy [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 11, 2001 1:56 PM
To: Chuck
Cc: PERL-CGI List
Subject: Re: Easy way to get output from system()


On Thu, 11 Oct 2001, Chuck wrote:

> I have several CGI's that use system() to get various OS details.
>
> What is the most reliable way to glean this information after using this
> command:
>
> For example:
>
> #!/bin/perl
>
> system("ls -l /tmp")
>
> How can I get that data?

Use backticks:

my $output = `ls -l /tmp`;

-- Brett
                                          http://www.chapelperilous.net/
------------------------------------------------------------------------
bug, n:
        A son of a glitch.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to