Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Can I use a regex here?

by repson (Chaplain)
on Apr 17, 2001 at 05:49 UTC ( #73029=note: print w/replies, xml ) Need Help??

in reply to Can I use a regex here?

Since the filenames follow a pattern, if the number of files is indeterminate or you perfer not to use the individual declarations shown above, you could do something like this:

rename $_, $OUT_DIR . "/allfiles/$_" for (glob 'pair*' . $RUN_NAME . '.log');

Alternately you could use opendir and readdir with a regex to check the filename instead using of shell-like globbing.

Replies are listed 'Best First'.
Re: Re: Can I use a regex here?
by mndoci (Scribe) on Apr 18, 2001 at 01:24 UTC
    This sounds good. My thinking is that since there is a pattern, I would like to use that in some way. Most of the suggestions to my earlier post sound good. However, if your suggestion works, it would be perfect.

    "What you do in this world is a matter of no consequence. The question is, what can you make people believe that you have done?"-Sherlock Holmes in 'A study in scarlet'

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://73029]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2018-01-20 13:43 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (226 votes). Check out past polls.