#!/usr/bin/perl -w use File::Copy; use strict; use Archive::Tar; my (@files,$i,$name,$ext,@file,$oldlocation,$tobe); my $tar = Archive::Tar->new(); $tar->read('some.tar'); $tar->extract(); @files=<*.tgz>; #print @files; for $i(0..$#files) { $file[$i]=do{local(@ARGV,$/)=$files[$i];<>}; ($name,$ext)=split(/\./,$files[$i]); mkdir("$name",0777)||print $!; $oldlocation="/home/newbie/ta/$file[$i]"; $tobe="/home/newbie/ta/$name/"; move ($oldlocation,$tobe); } exit;