http://www.perlmonks.org?node_id=966756


in reply to help with unraring

list_files_in_archive does not return references to the contained files but just dumps them to stdout. If you need to get the filenames then you must capture the stdout and process it. Instead of forking, use the IO::CaptureOutput module

use Archive::Unrar qw(list_files_in_archive process_file); use IO::CaptureOutput qw(capture); my @files; { local ($stdout, $stderr); capture sub {list_files_in_archive( file=>"C:/perl2exe/For perl 5.10. +1/test.rar" ,undef)}, \$stdout, \$stderr; @files=map {/Archive contents : (.*\.txt$)/ } split ("\n",$stdout); } foreach (@files) { print "file ",++$i," : ",$_,"\n"; }

Also check the $result value to get and indication of the error returned