Use command tick. That is:
$my_sys_out = `{SOME COMMAND`};
E.g.: $my_date = `date`;
__
William Ampeh (x3939)
Federal Reserve Board
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Use backticks...
my $output = `dir c:\\`;
Rob
-Original Message-
From: Mike Garner [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 14, 2002 12:36 PM
To: [EMAIL PROTECTED]
Subject: Getting System Output in Variable
How do you get the output of a system command into a variable without
How do you get the output of a system command into a variable without
piping to a temporary text file that I would later have to open and process?
Ex on win32:
system("dir c:\\ >dir.txt"); #pipe the directory listing to dir.txt
$var = system("dir c:\\ >dir.txt"); #only returns numerical codes for