[HRPM] Just a quick question...

Collin Cusce cusce at jlab.org
Thu Feb 8 16:38:26 CST 2001


Sweet! That is exactly what I needed to know. Thank you so much, I would not
have found that on my own.
----- Original Message -----
From: "Branson Matheson" <Branson.Matheson at FergInc.com>
To: <norfolk-pm-list at happyfunball.pm.org>
Sent: Thursday, February 08, 2001 5:28 PM
Subject: Re: [HRPM] Just a quick question...


> > Does perl handle dynamic directory handles?  If so, how would one do
> > it?  My instinct is to do this:  opendir(CURNT$i, "/etc"); but that
> > also goes against concatination rules.  Since I am far from a
> > workable piece and am too lazy to run a few tests, I thought I'd
> > actually use this mailing list for once.  Anyone know how do
> > acomplish something like this?
>
>  Yes .. you have to use the FileHandle module .. such as:
>
>  #! /usr/local/bin/perl
>
>  use FileHandle;
>
>  @dirs =  ( '/etc', '/usr/local', '/usr' ) ;
>
>  for $dir ( @dirs ) {
>   $dh{$dir} = new FileHandle;
> opendir $dh{$dir}, $dir;
> }
>
> @files = readdir($dh{'/etc'});
>
> for $file ( @files )

> print "$file\n";
> }
>
>  Hope this helps ;-)
>
>   - branson
>
> --------------------------------------------------------------------------
-----
> Branson Matheson                       "If you are falling off of a
mountain,
> Manager, Risk and Information Security   You may as well try to fly."
> Ferguson Enterprises, Inc.               - Delenn, Minbari Ambassador
>            ( $statements = <BRANSON> ) !~ /Corporate Opinion/;
>




More information about the Norfolk-pm mailing list