CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Win32 Programming Help:
win32 env: redirect output stream from command line using cgi script

 



hurukan
New User

Mar 15, 2006, 5:53 AM

Post #1 of 3 (2841 views)
win32 env: redirect output stream from command line using cgi script Can't Post

Hello,

I'm trying to execute a command from a perl script that is used to communicate with a mysql dbms. I'm trying to redirect the results from the console to a perl variable in order to process it.

The problem is that I read the documentation concerning the system() function but I never succeeded to redirect the output stream to this variable. I only get a sort of 'return code' in kind of integer of value 256.

Can you tell me how I could do that ?

Thanx

Dimitri


davorg
Thaumaturge / Moderator

Mar 22, 2006, 4:35 AM

Post #2 of 3 (2807 views)
Re: [hurukan] win32 env: redirect output stream from command line using cgi script [In reply to] Can't Post

Is there any reason why you're not using DBI and DBD::mysql to talk to your MySQL database? That would seem to be the easiest way to do it.

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks


hurukan
New User

Mar 22, 2006, 4:32 PM

Post #3 of 3 (2804 views)
Re: [davorg] win32 env: redirect output stream from command line using cgi script [In reply to] Can't Post

efectively, but it was simplier to redirect the output of a code that is already existing instead creating a new script that is doing exactly the same thing, but...

I tried, it is working with all the XP console dos-like commands but it seems that apache doesn't want to execute a java code outside of the space reserved for the scripts to be executed, but now this is no more a perl issue but an apache/java issue, thanks anyway for your help, ...

by the way

$myresultsfromoutput = `(antiquote) command line plus params`(anti quote again)

works better than

$mycommandtoexecute = qq~command line plus params~;
$myresults=qx/$mycommandtoexecute/;

don't know why ????

Dimitri

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives