Re: hash defining

2006-03-15 Thread JupiterHost.Net
Saurabh Singhvi wrote: Hi Hello, herez my data and i am having a problem #!/usr/bin/perl -w use strict; that will tell you a lot probably. You might want to "tableize" your giant hash to make it easier to read (pronounced "find obviouse mistakes") my %info = ( 'foo' => {

Re: hash defining

2006-03-15 Thread Saurabh Singhvi
Hi herez my data and i am having a problem #!/usr/bin/perl -w foreach $name (@ARGV) { $i=0; open(PDB,"$name") ; while ($line = ) { if ($line =~ /ATOM/) { ($title, $num, $atom, $acid, $rest) = split(/\s+/, $line, 5); if ($atom eq "CA") {

Re: hash defining

2006-03-15 Thread Mr. Shawn H. Corey
Ben Marsh wrote: %hash = ( "key" => {"key1" => value} ); To define a hash use () brackets the second hash is inserting not a hash but a reference to a hash so you use {} brackets. You refer to 'value' it as $hash{key}->{key1}. $hash{key} is a scalar contains a reference pointing to a hash (so $

Re: hash defining

2006-03-15 Thread Ben Marsh
* Saurabh Singhvi ([EMAIL PROTECTED]) wrote: > HI > > i was looking to make a hash inside hash. Something like > > %hash = { "key" => {"key1" => value} }; > > is this the correct way to define it??? Also, > is > $hash{key->key1} > > this the way to call it ?? if not kindly tell me. > > thanks

hash defining

2006-03-15 Thread Saurabh Singhvi
HI i was looking to make a hash inside hash. Something like %hash = { "key" => {"key1" => value} }; is this the correct way to define it??? Also, is $hash{key->key1} this the way to call it ?? if not kindly tell me. thanks Saurabh