Chris Charley wrote: > > (I've re-writteen your entire code below.You how much simpler it could be.) > > #!/usr/bin/perl > use strict; > use warnings; > use Bio::Seq; > use Bio::SeqIO; > > #initialize id and fasta files > my $codefile = $ARGV[0]; > my $treefile = $ARGV[1]; > > #open alignment list and create a global hash of tree codes with species > name as > #open gi id file and assign file handle > open(ID,$codefile)|| die "can't open id file: $!\n"; > > my %id_global; > > while (<ID>){ > my ($id, $code, undef) = split ' ', $_, 3;
If you want simpler then: my ($id, $code) = split; > $id_global{$code} = $id; > } :-) John -- Perl isn't a toolbox, but a small machine shop where you can special-order certain sorts of tools at low cost and in short order. -- Larry Wall -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>