What have you tried and failed at? Let's see some code please!
There is more ways of doing what you are asking than there are programmers programming in Perl. One suggestion I would give you is to run the "find2perl" command with a minimum of arguments to produce a file you can hack on.
For instance if I run the command
I will get the starts of a program in the file somefile.pl with the following contents:find2perl somedir -depth -type f > somefile.pl
Now an enterprising programmer can edit that file to give it any behaviors that they want, and to boot it is a good way to learn how to use the File::Find module and friends.#! /usr/bin/perl -w eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' if 0; #$running_under_some_shell use strict; use File::Find (); # Set the variable $File::Find::dont_use_nlink if you're using AFS, # since AFS cheats. # for the convenience of &wanted calls, including -eval statements: use vars qw/*name *dir *prune/; *name = *File::Find::name; *dir = *File::Find::dir; *prune = *File::Find::prune; sub wanted; # Traverse desired filesystems File::Find::finddepth({wanted => \&wanted}, 'somedir'); exit; sub wanted { my ($dev,$ino,$mode,$nlink,$uid,$gid); (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && -f _; }
Now, if you wanted to re-invent the wheel you could also write something that was a combination of calls to opendir and friends with some glob calls to handle wildcards and things like that.
I hope this nudges you on to the path of Perl Rightousness...
In reply to Re: To retrieve all files according to given path list
by blue_cowdawg
in thread To retrieve all files according to given path list
by devlele
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |