Bill Akins wrote:

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

have you try:

open(ZIP,'unzip -c $myfile1 |') || die $!;
while(<ZIP>){
        #-- do whatever you want to do...
}
close(ZIP);

david

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

Reply via email to