Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: problem with pattern match

by Yary (Pilgrim)
on Jun 11, 2010 at 19:05 UTC ( [id://844281]=note: print w/replies, xml ) Need Help??


in reply to Re: problem with pattern match
in thread problem with pattern match

I'm not quite sure what is actually implemented there...

My guess is that the programmer's directory has 3 files starting with "www" in it. <\w{3,4}> in some shells will match a file that begins with www or wwww. The angle brackets would cause a directory glob, setting $_ to file names matching what's inside once per loop.

On the other hand, according to "perldoc File::Glob", that pattern should match only files named "w3" or "w4". And even if the shell was interpreting it, it would only match files "www" or "wwww" with nothing following, since it doesn't end with a "*". So I'm a bit at a loss as well.

Replies are listed 'Best First'.
Re^3: problem with pattern match
by jwkrahn (Abbot) on Jun 11, 2010 at 19:25 UTC

    Your guess would be wrong.    Whether or not there are matching file names the file glob operator will return the two strings 'w3' and 'w4'.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2024-03-28 22:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found