#!/usr/bin/perl use common::sense; use File::Unpack; my %hash = ('path' => './archive/attic.bz2', 'dest' => './unpack'); extract( \%hash ); sub extract { my $log; my $u = File::Unpack->new(destdir => $_[0]->{'dest'}, one_shot => 1, verbose => 2, logfile => \$log); $u->unpack( $_[0]->{'path'} ); }