my $min_depth = 0; find( { wanted => \&wanted, }, @dirs); sub wanted { my $depth = $File::Find::dir =~ tr[/][]; return if $depth < $min_depth; if ( $File::Find::name =~ m/.zip\z$|file.*?\z$|.bak\z$|.jar\z$|.war\z$/g ) { print "I am extracting zip file : $File::Find::name\n"; system("unzip -o $File::Find::name"); } if ( $File::Find::name =~ m/.tar.gz\z$/ ) { &execute_command("tar -xzvf $File::Find::name"); } if ( $File::Find::name =~ m/.iso\z$/ ) { system("mkdir /tmp/mnt"); system("mount -o loop $File::Find::name /tmp/mnt"); my @dirs = ( '/tmp/mnt' ); find ( { wanted => \&wanted, },@dirs ); system("unmount /tmp/mnt"); system("rm -rf /tmp/mnt"); } if ( $File::Find::name =~ m/.SYS$|.sys$|.sys2$|.SYS2$|.cmptag$|.swtag$|.swidtag$|.tag$|.fxtag$/ ) { print "$File::Find::name\n"; my $fsize = stat($File::Find::name); $fileparamhash->{$File::Find::name}->{Size} = $fsize->size; if ( $File::Find::name =~ m/.swtag$/ ) { my $parser = XML::LibXML->new; my $doc = $parser->parse_file("$File::Find::name"); my $FileDescription; my $versionname; my @filedesc = $doc->getElementsByTagName("ProductName"); foreach ( @filedesc ) { $FileDescription = $_->textContent; } my @versions = $doc->getElementsByTagName("ProductVersion"); foreach ( @versions) { $versionname = $_->textContent; } $fileparamhash->{$File::Find::name}->{FileDescription} = $FileDescription; $fileparamhash->{$File::Find::name}->{FileVersion} = $versionname; } } } }