in reply to Re: Yet Another Tar-Gzip File Expander
in thread Yet Another Tar-Gzip File Expander
That was not meant to flame you, just to point it out for others who read this.next unless $file =~ /\.t(?:ar\.)?gz\z/); # it should be next unless ($file =~ /\.t(?:ar\.)?gz\z/);
Of Course this is still a few lines larger than yours, but you see, this is my code and I kept it how i originally wrote it. No offense to you, but that is your code. Besides the fact that I did not explain my whole purpose in writing this program. I am going to expand this and need to have the directory read into an array for later use. Thanx again.#!/usr/bin/perl -w $|++; use strict; my (@list, $d, $i); die "Need Directory Param!\n" unless $ARGV[0]; my $cmd = qq/tar -zxvf /; opendir LOCAL,$ARGV[0] || die "Cannot Open dir $ARGV[0]"; @list = readdir LOCAL; foreach $d (0..$#list) { if($list[$d] =~ /.+\.t?(ar\.)?gz/) { qx/$cmd $ARGV[0]\/$list[$d]/; $i++; } } print "$i files expanded!\n"; closedir LOCAL;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Yet Another Tar-Gzip File Expander
by Anonymous Monk on May 14, 2002 at 01:53 UTC | |
|
Re: Re: Re: Yet Another Tar-Gzip File Expander
by thelenm (Vicar) on May 14, 2002 at 03:48 UTC | |
by straywalrus (Friar) on May 14, 2002 at 19:39 UTC |