in reply to Re^2: To retrieve all files according to given path list
in thread To retrieve all files according to given path list

I have tried following code, where I am assigning @ARGV[0] to $directory variable and then passing $directory variable to sub wanted as you can see in the following code. But it only accepts "C:\directoryname" as an argument. I want the code to handle all the cases such as "C:\", "C:\*", C:\direcoryname\*" etc as I showed in my original email. Also is there any way to handle multiple paths or pathlist provided on command line ?

When I'm under windows I often do

BEGIN { @ARGV = map glob, @ARGV }

And indeed to File::Find's find() you can pass more than one directory to search. From perldoc File::Find:

SYNOPSIS use File::Find; find(\&wanted, @directories_to_search); sub wanted { ... } use File::Find; finddepth(\&wanted, @directories_to_search); sub wanted { ... }