in reply to Re: Re: How to open sub FH when filename is passed to sub?
in thread How to open sub FH when filename is passed to sub?

Then you probably want something like this:
#!/usr/bin/perl -w use strict; create_hash('out_file.txt'); sub create_hash { my $filename = shift; my %hash; my @symbol = ('D'..'M'); my @protein = ( 'Aspartic Acid', 'Glutamic Acid', 'Phenylalanine', 'Glycine', 'Histidine', 'Isoleucine', 'Lysine', 'Leucine', 'Methionine', 'Asparagine', ); @hash{@symbol} = @protein; open(FILE,'>',$filename) or die "can't write $filename: $!"; while(my($key,$val) = each %hash) { print FILE "$key:$val\n"; } }

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)