G
Geoff Cox
Sure, it's not that complicated.
Many thanks John - very helpful.
You might like to know that I gave this assistance of yourself and the
others as an example of the better side to the Internet, tonight, at a
talk I gave at our local Computer Club!
Cheers
Geoff
$_ contains the name of the current file which is assigned to $name. A
substitution is performed on $name and if it ends with the four
characters '.zip' (or '.ZIP' or '.Zip', etc.) they are replaced with the
four characters '.doc'. If the substitution was not successful (the
file name didn't end in '.zip') return from the sub. If successful $_
will contain 'somefile.zip' and $name will contain 'somefile.doc'.
Create an Archive::Zip object using the file name in $_.
$zip->extractMember( ($zip->memberNames)[ 0 ], $name );
Use $zip->memberNames to get the first file name from the zip archive
and use $zip->extractMember to store the contents of that file using the
file name in $name.
Delete (unlink) the file $_ or complain if you can't.
Use the directory name in $dir as the starting point in the search.
John