Hanken has asked for the wisdom of the Perl Monks concerning the following question:
Hi, Monks!
I got serval hash tables and I want to print them into separated files. So I write a sub and wanna pass a FILE_H to it. My code is:
I got serval hash tables and I want to print them into separated files. So I write a sub and wanna pass a FILE_H to it. My code is:
Can anybody tell me how to do it, or just give me some hints on how to quickly write different hashes into different files? Thanks!open (FH_01 , ">", "file_01.txt" ) || die "open failed $!"; &hash2file(\%hash_regs, <FH_01>); # it dosen't work &hash2file(\%hash_regs, FH_01); # illegal syntax &hash2file(\%hash_regs, "file_01.txt"); # illegal syntax too
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How can I pass File_Handle to a subroutine?
by psini (Deacon) on Jul 01, 2008 at 08:16 UTC | |
by Hanken (Acolyte) on Jul 01, 2008 at 08:32 UTC | |
by Hue-Bond (Priest) on Jul 01, 2008 at 09:10 UTC | |
Re: How can I pass File_Handle to a subroutine?
by Burak (Chaplain) on Jul 01, 2008 at 08:11 UTC |
Back to
Seekers of Perl Wisdom