Bill Akins wrote:
> 
> Hi All,

Hello,

> 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")));


This works for me (on Linux):

my $text = qx(unzip -p $myfile1 doc.txt);



John
-- 
use Perl;
program
fulfillment

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

Reply via email to