On Thu, 26 Jul 2001, Frank Newland wrote:

> I want to print the contents of an archived file. When I run this script,
> all it does is uncompress my file.
>
> Q:
> 1. Isn't CONTENTS a file handle to the uncompressed file?

No.  I think what you want is uncompress -c, which dumps the file to
standard output, so you can pipe it to something, like tar or whatever.

> #!/usr/bin/perl
> use strict ;
> open (CONTENTS, "compress -d  archive.Z  | " ) or die "In the
> rain....alone";
> while (<CONTENTS>) {
> chomp ;
> print ;
> }
> close (CONTENTS) or die "like Arch Stanton..."

Why are you chomping?  If you strip trailing newlines, your output is
going to be all run together.


-- Brett

Brett W. McCoy
Software Engineer
Broadsoft, Inc.
240-364-5225
[EMAIL PROTECTED]


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

Reply via email to