Created
October 30, 2012 20:17
-
-
Save moltar/3982724 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use warnings; | |
use strict; | |
use Archive::Tar; | |
my $filename = $ARGV[0]; | |
die "Specify filename as first argument.\n" unless $filename; | |
my $tar = Archive::Tar->new; | |
$tar->read($filename); | |
if ($tar->contains_file('./')) { | |
$tar->remove('./'); | |
$tar->write($filename); | |
} else { | |
warn "No root entry in $filename\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment