Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Passing regex to a subroutine

by aitap (Curate)
on Oct 12, 2012 at 19:33 UTC ( #998779=note: print w/replies, xml ) Need Help??


in reply to Passing regex to a subroutine

Did you mean my @list = grep { $_ =~ $regexStr } glob "$getDir/*";? (untested)
Sorry if my advice was wrong.

Replies are listed 'Best First'.
Re^2: Passing regex to a subroutine
by ll001 (Initiate) on Oct 12, 2012 at 19:47 UTC

    That's what was missing. I had created a chicken and egg situation for myself because I had not expanded it correctly. Thanks for the help. -J

      Actually your problem was that you passed the regex to a command (`dir`) that didn't understand it. Doing it all in Perl makes much more sense of course, but if the suffix is significant you'll still have to integrate it into the regex.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://998779]
help
Chatterbox?
[erix]: the annoying thing is that during setup of the 'foreign table' you have to specify all the columns. But that is reasonably automatable (just reading header line, and contruct the needed CREATE FOREIGN TABLE' statement)
[erix]: it may be easier to just slurp your fils into regular tables. Has other infrastructure advantages also (indexes, constraints etc)

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (9)
As of 2018-02-23 15:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (302 votes). Check out past polls.

    Notices?