| 1 | #!/usr/bin/perl | ||
| 2 | use strict; | ||
| 3 | use warnings; | ||
| 4 | use DBM::Deep; | ||
| 5 | use File::Spec; | ||
| 6 | use Cwd; | ||
| 7 | my $file = shift @ARGV or die; | ||
| 8 | my $zip = 0; | ||
| 9 | if ($file =~ /\.zip$/i) { | ||
| 10 | $zip = 1; | ||
| 11 | my ($v,$p,$f) = File::Spec->splitpath($file); | ||
| 12 | my $dir = Cwd::cwd(); | ||
| 13 | chdir($p); | ||
| 14 | system('unzip', $f); | ||
| 15 | chdir $dir; | ||
| 16 | $file =~ s/\.zip$//i; | ||
| 17 | } | ||
| 18 | tie my %hash => 'DBM::Deep', $file; | ||
| 19 | use Data::Dumper; | ||
| 20 | print Dumper \%hash; | ||
| 21 | if ($zip) { | ||
| 22 | unlink($file); | ||
| 23 | } |