in reply to Re: Regex Question
in thread Regex Question

Thanks nefigah. That worked. Now, how do I read the directory for that file pattern within the script?

Is there a link that explains all of the File:: functions?

Replies are listed 'Best First'.
Re^3: Regex Question
by nefigah (Monk) on Mar 10, 2008 at 16:48 UTC
    Well, I'm pretty new too, so not sure if this is the best way, but I would use the glob function as was recommended earlier, something like this:
    use File::Basename; my $dir = dirname($path); $dir .= '/*'; # Note: if the result of dirname already has the slash, +you only need to add the * while (glob $dir) { # this will loop through files in that directory, putting each filen +ame in $_ }
    You can check out perldoc -f glob at the command line or perldoc.org!


    I'm a peripheral visionary... I can see into the future, but just way off to the side.