Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: If statements with . and .. filehandles.

by tune (Curate)
on Jun 18, 2002 at 21:09 UTC ( #175497=note: print w/ replies, xml ) Need Help??


in reply to If statements with . and .. filehandles.

Or use the mighty regexp solution.

print "$file\n" if $file !~ /^\.{1,2}$/;

--
tune


Comment on Re: If statements with . and .. filehandles.
Download Code
Replies are listed 'Best First'.
Re: Re: If statements with . and .. filehandles.
by dsheroh (Parson) on Jun 18, 2002 at 23:49 UTC
    Correction:
    print "$file\n" if $file !~ /\A\.{1,2}\Z/;
    Using ^ and $ would also match files named .\n or ..\n.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2015-08-04 23:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (76 votes), past polls