####################################################################### # # Archive-Unrar version 1.2 - Perl wrapper for unrar.dll. # Manipulates RAR format compressed archives by using the unrar dll dynamic library # # Author: Nikos Vaggalis # ####################################################################### Archive::Unrar is a procedural module that provides manipulation (extraction and listing of embedded information) of compressed RAR format archives by interfacing with the unrar.dll dynamic library for Windows. It uses two functions : list_files_in_archive and process file The first one lists details embedded into the archive (files bundled into the .rar archive,archive's comments and header info) and the latter extracts the files from the archive. list_files_in_archive takes two parameters;the first is the file name and the second is the password required by the archive. If no password is required then just pass undef or the empty string as the second parameter process_file takes three parameters;the first is the file name, the second is the password required by the archive and the third is the directory that the file's contents will be extracted to. If no password is required then just pass undef or the empty string as the second parameter Both procedures return undef if successfull, and an error description if something went wrong $result=process_file($file,$password); print "There was an error : $result" if defined($result); sample usage : use Archive::Unrar qw(list_files_in_archive process_file); #usage with password list_files_in_archive($file,$password); process_file($file,$password); #usage without password list_files_in_archive($file,undef); process_file($file,undef); #if RAR archive in the same directory as the caller list_files_in_archive("testwithpass.rar","mypassword"); process_file("testwithpass.rar","mypassword"); #absolute path if RAR archive is not in the same directory as the caller list_files_in_archive("c:\\input_dir\\testwithpass.rar","mypassword"); process_file("c:\\input_dir\\testwithpass.rar","mypassword"); #optionally, provide output directory as the last parameter, #if directory does not exist then it will be automatically created #if output directory is not provided then the file is extracted #in the same directory the caller list_files_in_archive("c:\\input_dir\\testwithpass.rar","mypassword"); process_file("c:\\input_dir\\testwithpass.rar","mypassword","c:\\output_dir"); #without a password process_file("c:\\input_dir\\testnopass.rar",undef,"c:\\output_dir"); INSTALLATION To install this module type the following: perl Makefile.PL make make test make install DEPENDENCIES Must have unrar.dll in %SystemRoot%\System32. Get it from UnRAR dynamic library for Windows software developers at http://www.rarlab.com/rar/UnRARDLL.exe This module requires these other modules and libraries: Win32::API Carp COPYRIGHT AND LICENCE Copyright (C) 2009 by Nikos Vaggalis This library and all of its earlier versions are licenced under GPL3.0 For a complete application based on the module look at : L