Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Regex Question

by nefigah (Monk)
on Mar 10, 2008 at 16:10 UTC ( #673267=note: print w/ replies, xml ) Need Help??


in reply to Regex Question

I would look at File::Basename!



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


Comment on Re: Regex Question
Re^2: Regex Question
by LouM (Initiate) on Mar 10, 2008 at 16:39 UTC
    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?
      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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://673267]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (10)
As of 2014-11-28 17:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (199 votes), past polls