http://qs1969.pair.com?node_id=287676


in reply to testing for a zip file

You can (in no particular order)
  1. call qx[ file $file ] and grep if the output says it's a ZIP file
  2. read the first few bytes and see if they match the string PK\003\004
  3. use Archive::Zip (this may or may not help)