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

Re: get list of files matching part of file name

by Anonymous Monk
on Jul 11, 2012 at 16:15 UTC ( #981184=note: print w/replies, xml ) Need Help??


in reply to get list of files matching part of file name

What a strange way to use glob(). You're better off with proper use of readdir():

# open current directory for reading opendir my $dh, '.' or die; # iterate through the entries while (my $dir = readdir($dh)) { # your code here } closedir $dh;

If you want to use glob() properly, you need to do glob("*/*sample*") to get every file in the current directory's immediate subdirectories with 'sample' in its name.

There seems to be at least one real bug in your code: You aren't in /home/test when you do the glob.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://981184]
help
Chatterbox?
[Corion]: A good morning to everybody!
[Lady_Aleena]: Morning Corion.
[Corion]: I spent yesterday evening (and early night) in VR in Vanishing Realms, and can really recommend it
Discipulus is a very sad mornig anyway..
[Corion]: The title/"cover" image doesn't convey the comic/painted style, and the gameplay is really diverse, especially for a VR game

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2017-05-23 07:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?