RE: IO::Compress::Gzip creates empty file
- From: rfernandez@xxxxxxxxx (Richard Fernandez)
- Date: Thu, 31 Jan 2008 15:08:53 -0500
Hi Tom, thanks for the reply.
my $old_name = "$company.$ext.$date";
my $new_name = "$old_name.gz";
warn "File '$old_name' is empty" if -z $old_name;
warn "File '$old_name' isn't really a file" unless -f _;
unlink $new_name; # whether it's there or not
gzip $old_name => $new_name,
BinModeIn => 1
or do {
warn "Failed to gzip file: '$old_name': $GzipError";
next DOTDONE;
};
warn "File '$new_name' not created as expected"
unless -f $new_name and -s _;
I made the changes you suggested and re-ran it. The program just comes
back to a prompt. No warnings, no nothing, and still no data in the
gzip'd file!
Your code, though, prompts a question on syntax. In 2 places you specify
an underscore without a '$' in front of it. This is the first time I've
seen this. Running 'perl -c' says the syntax is clean, but I couldn't
find any reference to that usage in perlsyn. Is the '$' implied because
of the context?
Can you please explain or point me to the doc? Thanks.
Are you using both 'strict' and 'warnings'?
I am using both 'strict' and 'warnings'. Doesn't everyone ;)
Thanks again.
richf
.
- Follow-Ups:
- Re: IO::Compress::Gzip creates empty file
- From: John W. Krahn
- Re: IO::Compress::Gzip creates empty file
- From: Tom Phoenix
- Re: IO::Compress::Gzip creates empty file
- References:
- Re: IO::Compress::Gzip creates empty file
- From: Tom Phoenix
- Re: IO::Compress::Gzip creates empty file
- Prev by Date: Command line installing perl modules
- Next by Date: Re: IO::Compress::Gzip creates empty file
- Previous by thread: Re: IO::Compress::Gzip creates empty file
- Next by thread: Re: IO::Compress::Gzip creates empty file
- Index(es):
Relevant Pages
|