I think, when you use system(), that you're expecting something it's not
going to give you.  I found this out trying to use grep.  I said 
        my $Value = system("grep -l somevalue somefile")
and the return was always 0.  I found, though, that instead of using system,
use the '`' character:
        my $Value = `grep -l somevalue somefile`
and now it works find.  So, in your case, I would write

$text .= `unzip $myfile1 doc.txt`;


Sean

-----Original Message-----
From: Bill Akins [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 26, 2002 1:34 PM
To: [EMAIL PROTECTED]
Subject: Read a file directly from system call?


Hi All,

I need to read in a file from a system call.  I need to extract a file
(doc.txt) from a zip file ($myfile1) and read it directly in from a pipe
instead of writing to disk, then opening the file.  My system call is:
system ("unzip $myfile1 doc.txt"); which works fine to extract the file to
disk.

I would like the contents of doc.txt to be stored in/appended to a var named
$text.  I have tried:
$text .= system("unzip $myfile1 doc.txt");
$text .= (system("unzip $myfile1 doc.txt"));
$text .= "system("unzip $myfile1 doc.txt")";
$text .= [system("unzip $myfile1 doc.txt")];
and just about every variation I can think of.  Of course none of these
returned the expected results, and
$text -> system("unzip $myfile1 doc.txt");
which would only work if it's a pm
I also tried variations on:
open (MYFILES, (system("unzip $myfile1 doc.txt")));

Any clues?  Thanx!
Please reply directly and to list.


Bill Akins, CNE
Sr. OSA
Emory Healthcare
(404) 712-2879 - Office
12674 - PIC
[EMAIL PROTECTED]




-- 
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