CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate: Re: [Griff] Opening files with hash array values: Edit Log



FishMonger
Veteran / Moderator

Jul 31, 2011, 9:13 PM


Views: 1679
Re: [Griff] Opening files with hash array values


Code
my %files = ( 
SUBHIST => $subscriberHist,
SUBDUPE => $subscriberDupe,
SUBCLN => $subscriberCln,
SUBDISC => $subscriberDisc,
);

my %file_handle;
create_filehandles(\%files);

sub create_filehandles {
my $files = shift;
foreach my $label ( keys %$files ) {
open $file_handle{$label}, '<', $files{label}
or die "can't open '$files{$label}' for reading $!";
}
}



(This post was edited by FishMonger on Jul 31, 2011, 9:14 PM)


Edit Log:
Post edited by FishMonger (Veteran) on Jul 31, 2011, 9:13 PM
Post edited by FishMonger (Veteran) on Jul 31, 2011, 9:14 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives