Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: reading from directory

by moodster (Hermit)
on Aug 20, 2002 at 08:32 UTC ( [id://191412]=note: print w/replies, xml ) Need Help??


in reply to Re: reading from directory
in thread reading from directory

Since there is More Than One Way To Do It, you could also go for the object-oriented approach using DirHandle:
use DirHandle; my $dh = new DirHandle; $dh->open( 'MainDir' ); foreach ( grep /\.cpp$/, $dh->read ) { # do stuff } $dh->close;
The DirHandle module is a wrapper around opendir and its relatives, so this is essentially the same as CubicSplines answer, just another way of writing it.

Cheers,
--Moodster

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2024-04-24 23:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found