Christiane Nerz wrote:
> Andrew Gaffney wrote:
>
> > James Edward Gray II wrote:
> > What you probably want is:
> >
> > foreach (keys %hash) {
> > print "$_ => $hash{$_}\n";
> > }
> >
> oh nice - like that I get all keys and the corresponding values printed..
> But I only wanted to get all value
Christiane Nerz wrote:
>
> Good morning!
Hello,
> Thx for your help..
>
> The problem seems to lay in "filling the hash".
> But I can't see why.
>
> I want to compare two fasta-files, more precisely the IDs of two sets
> of sequences.
I take it that the ID is everything between ' >' and "\n"
[ Please do not top-post. TIA ]
Christiane Nerz wrote:
>
> Nope - 'cause if I print out the values key for key, I get all four:
>
> my $array = keys %hash;
$array is a scalar and holds a single value. It is not related to
@array in any way.
> print $hash{$array[0]};
> print"\n";
> print $ha
On Wednesday, Nov 12, 2003, at 02:15 US/Pacific, Christiane Nerz wrote:
Hi everybody!
I got the mistakes - no bugs but simple human errors ;-)
My program wasn't working correctly, because two hashes wasn't filled
properly and the reason for the miraculous different output of the
values of that
Good morning!
Thx for your help..
The problem seems to lay in "filling the hash".
But I can't see why.
I want to compare two fasta-files, more precisely the IDs of two sets
of sequences.
Each file looks like:
>gi|13699918|dbj|BAB41217.1|.
MSEKEIWEKVLEIAQEKLSAVSYSTFLKDTELYTIKDGEAIVLSSIPFNANWL
oh nice - like that I get all keys and the corresponding values printed..
But I only wanted to get all values :-)
Jane
Andrew Gaffney wrote:
James Edward Gray II wrote:
On Nov 11, 2003, at 1:47 PM, Christiane Nerz wrote:
Hi!
If I want to print out every value of a hash, what's wrong with doing
jepp - all four are there..
I really don't understand it.
thx so far - I have to finish for today - my little baby-son is crying :-(
Jane
...
As near as I can tell, the above two chunks of code have identical
effects. If you put the first chunk in the program EXACTLY where the
foreach() loop
Nope - 'cause if I print out the values key for key, I get all four:
my $array = keys %hash;
print $hash{$array[0]};
print"\n";
print $hash{$array[1]};
print"\n";
print $hash{$array[2]};
print"\n";
print $hash{$array[3]};
With the code
foreach (keys %hash) {
print $hash{$_};
print
Hi everybody!
I got the mistakes - no bugs but simple human errors ;-)
My program wasn't working correctly, because two hashes wasn't filled
properly and the reason for the miraculous different output of the
values of that hash was a simple typo - I typed once hash_fasta1 and
the second time
Christiane Nerz wrote:
>
> Hi!
Hello,
> If I want to print out every value of a hash, what's wrong with doing it
> like that:
>
> foreach (keys %hash) {
> print $hash{$_};
> print "\n";}
Nothing wrong with that but if you just want the values then use
values() instead of keys().
for
On Tuesday, Nov 11, 2003, at 11:47 US/Pacific, Christiane Nerz wrote:
Hi!
If I want to print out every value of a hash, what's wrong with doing
it like that:
foreach (keys %hash) {
print $hash{$_};
print "\n";}
Why do I only get one value???
probably because there is only One Value in
James Edward Gray II wrote:
> On Nov 11, 2003, at 2:08 PM, Christiane Nerz wrote:
>
>> Nope - 'cause if I print out the values key for key, I get all four:
>>
>> my $array = keys %hash;
$array is a scalar, which gets the number of keys in %hash. not the actual
keys in %hash. you probably want m
If you would like to post more of your code, I would be happy to take a
look at it.
James
On Nov 11, 2003, at 2:27 PM, Christiane Nerz wrote:
jepp - all four are there..
I really don't understand it.
thx so far - I have to finish for today - my little baby-son is crying
:-(
Jane
...
As near
On Nov 11, 2003, at 2:08 PM, Christiane Nerz wrote:
Nope - 'cause if I print out the values key for key, I get all four:
my $array = keys %hash;
print $hash{$array[0]};
print"\n";
print $hash{$array[1]};
print"\n";
print $hash{$array[2]};
print"\n";
print $hash{$array[3]};
With the code
foreach
James Edward Gray II wrote:
On Nov 11, 2003, at 1:47 PM, Christiane Nerz wrote:
Hi!
If I want to print out every value of a hash, what's wrong with doing
it like that:
foreach (keys %hash) {
print $hash{$_};
print "\n";}
Why do I only get one value???
I don't seen anything wrong with y
On Nov 11, 2003, at 1:47 PM, Christiane Nerz wrote:
Hi!
If I want to print out every value of a hash, what's wrong with doing
it like that:
foreach (keys %hash) {
print $hash{$_};
print "\n";}
Why do I only get one value???
I don't seen anything wrong with your code. I believe there is
Hi!
If I want to print out every value of a hash, what's wrong with doing it
like that:
foreach (keys %hash) {
print $hash{$_};
print "\n";}
Why do I only get one value???
Jane
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
17 matches
Mail list logo