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

Re^4: Using grep and glob to find directories containing file

by Anonymous Monk
on Feb 03, 2013 at 17:21 UTC ( #1016840=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    mkdir dir1 dir2
    touch dir1/f{1,2}
    
  2. or download this
    foreach (1,2,3,4) {
    print "dir1\n" if glob("dir1/f*");
    print "dir2\n" if glob("dir2/f*");
    }
    
  3. or download this
    print "dir1\n" if glob("dir1/f*");
    print "dir2\n" if glob("dir2/f*");
    ...
    print "dir2\n" if glob("dir2/f*");
    print "dir1\n" if glob("dir1/f*");
    print "dir2\n" if glob("dir2/f*");
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1016840]
help
Chatterbox?
[Lady_Aleena]: I'm glad I've sort of learned command line grep so I can find where and how I've used this sub.
[Lady_Aleena]: Having to rewrite some parts of my site for mobile devices is such a pain in the butt.
[shmem]: Lady_Aleena: what editor are you using, on what platform?

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2017-04-27 11:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (505 votes). Check out past polls.