develooper Front page | perl.beginners | Postings from January 2002

array of filenames to open

Thread Previous | Thread Next
From:
Yacketta, Ronald
Date:
January 9, 2002 08:44
Subject:
array of filenames to open
Message ID:
544CF8DBB77FD411B17400508BAEBD1104E820F8@USA0875MS1
Folks,

looking for a simple example of putting a set of filenames into an array
and then opening each of them for parsing.

I was think of 


@files = ( "file1", "file2", "file3" );

foreach $file (@files) {
	open FN, "< $file";
	do something here
	close
}


am I correct? or isthere a better way todo this?

-Ron


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About