use Archive::Rar::Passthrough; my $rar = Archive::Rar::Passthrough->new(); if (not $rar) { print "Could not find your 'rar' command'.\n"; } my $errorcode = $rar->run( command => 'a', switches => ['-m0'], archive => 'my.rar', filelist_files => [ 'test.txt' ], ); if ($errorcode) { print "There was an error running 'rar': " . $rar->explain_error($retval) . "\n"; my $output = $rar->get_stdout(); my $errors = $rar->get_stderr(); print "The 'rar' command said (if anything):\n" . $output . "\nAnd spammed on STDERR:\n" . $errors . "\n"; }