Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: glob an array?

by Marshall (Canon)
on Feb 14, 2021 at 03:00 UTC ( [id://11128351]=note: print w/replies, xml ) Need Help??


in reply to Re^2: glob an array?
in thread glob an array?

Geez! I have no idea exactly what I was thinking 2 years ago and why my post was so terse - could be a lot of reasons behind that!

There is no way to use glob() on an array.
If I knew how to do that, I would have said so! The closest "glob like" solution is what ikegami pointed out in his also very terse post.
use Text::Glob qw( match_glob glob_to_regex ); Of course those functions are not glob() itself. This module generates a regex "under the covers" and then uses it.

My post shows the block form of grep, which I prefer. I guess I could have said things like this eliminates a module dependency and will execute faster. I could have also said: "When you think about a subset of an array, think grep. grep could have been called 'filter'". If you are having trouble with simple regexes, we can help you with that. For some reason, I didn't say any of that. I just showed how to do it with grep in a very terse post.

Very few, if any Monk posts are destined to be included in the tomes of Western Literature.
From the comment to my post, other Monks did examine and review what I said at the time. And I made adjustments to their messages with appropriate credit given.
I find your critique of my post odd because you aren't asking about a clarification of details that you plan to use yourself in your own coding.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-26 01:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found