But i don't know how to make it to search in every folder.
One of the ways of doing that, is using either a recursive subroutine, or use File::Find module.
Using a recursive subroutine:
For Example: To list out all the files in different folders in a directory like so:
This can even get simplier using a File::Find module like so:use warnings; use strict; scan_dir( $ARGV[0] ); ## call subroutine sub scan_dir { my ($dir) = @_; if ( -d $dir ) { ## check if directory opendir my $dh, $dir or die "can't open directory: $!"; while ( readdir $dh ) { next if $_ eq '.' or $_ eq '..'; print $_, $/; scan_dir("$dir/$_"); ## recursive call } } }
NOTE:Please, that the codes above is to show how you can transverse a dircetory. To get your rar files, and "unrar", is left for you to figure out. Am sure you will get around it! :)use warnings; use strict; use File::Find qw(find); find(\&scan_dir,$ARGV[0]); sub scan_dir{ return if $_ eq '.' or $_ eq '..'; print $_,$/; }
In reply to Re: unrar from multiple directories
by 2teez
in thread unrar from multiple directories
by cesapun
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |