#!/usr/local/bin/perl -w eval 'exec /usr/local/bin/perl -w -S $0 ${1+"$@"}' if 0; # not running under some shell use strict; use Archive::Tar; use File::Find; my $switches = shift @ARGV; my $tarfile = "./default.tar"; my ($create, $list, $extract, $compress, $debug, $verbose) = (0, 0, 0, 0); if (!$switches) { print<1) { die "More than one of x, c and t doesn't make sense.\n"; } elsif ($list) { print join "\n", Archive::Tar->list_archive ($tarfile),""; } elsif ($extract) { Archive::Tar->extract_archive ($tarfile); } elsif ($create) { my @f; find (sub { push @f,$File::Find::name; print $File::Find::name,"\n" if $verbose}, @ARGV); Archive::Tar->create_archive ($tarfile, $compress, @f); }