monkfan has asked for the wisdom of the Perl Monks concerning the following question:
__DATA__ >EP11110 (-) TGCAATCACTAGCAAGCTCTC GCTGCCGTCACTAGCCTGTGG >EP40005 (+) GGGGCTAGGGTTAGTTCTGGA NNNNNNNNNNNNNNNNNNNNN
And the following code I have fail to get what I want.$VAR = { 'EP11110' => 'TGCAATCACTAGCAAGCTCTCGCTGCCGTCACTAGCCTGTGG', 'EP40005' => 'GGGGCTAGGGTTAGTTCTGGANNNNNNNNNNNNNNNNNNNNN',};
#!/usr/bin/perl -w use strict; use Data::Dumper; my %hash=(); my $str; while (<DATA>) { chomp; /^>(\w+)/; $hash{$1} = $str; $str .= $_; #next; } print Dumper \%hash;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Concatenating text for a hash problem
by ikegami (Patriarch) on Oct 15, 2004 at 06:54 UTC | |
by deibyz (Hermit) on Oct 15, 2004 at 11:17 UTC | |
|
Re: Concatenating text for a hash problem
by pg (Canon) on Oct 15, 2004 at 05:53 UTC | |
by bobf (Monsignor) on Oct 15, 2004 at 06:04 UTC | |
by ihb (Deacon) on Oct 15, 2004 at 06:38 UTC | |
|
Re: Concatenating text for a hash problem
by ihb (Deacon) on Oct 15, 2004 at 06:05 UTC | |
|
Re: Concatenating text for a hash problem
by TedPride (Priest) on Oct 15, 2004 at 06:31 UTC | |
|
Re: Concatenating text for a hash problem
by pizza_milkshake (Monk) on Oct 15, 2004 at 05:56 UTC | |
|
Re: Concatenating text for a hash problem
by Roger (Parson) on Oct 15, 2004 at 12:39 UTC | |
by ikegami (Patriarch) on Oct 15, 2004 at 15:10 UTC |