Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: Storing data into hashes

by Corion (Pope)
on Dec 31, 2012 at 10:13 UTC ( #1011034=note: print w/replies, xml ) Need Help??


in reply to Re^2: Storing data into hashes
in thread Storing data into hashes

Hashes don't interpolate in strings:

#!perl -w use strict; my %SeqRec; print ("content of hash is %SeqRec\n");

I recommend to use Data::Dumper for debugging contents of variables:

use Data::Dumper; my %SeqRec = (foo => 'bar'); print ("content of hash is " . Dumper \%SeqRec);

Replies are listed 'Best First'.
Re^4: Storing data into hashes
by rkrish (Acolyte) on Dec 31, 2012 at 10:20 UTC

    is the way of storing data I have mentioned into hash is correct because i dont see any data actually stored in it. the output showed as :

    contents of hash is $VAR1 = { '' => undef, 'foo' => 'bar'

      When I run the code I showed, I get different output:

      use Data::Dumper; my %SeqRec = (foo => 'bar'); print ("content of hash is " . Dumper \%SeqRec);
      content of hash is $VAR1 = { 'foo' => 'bar' };

      Your output is at least missing the closing bracket. If you want to debug this, please show the full code you're running.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1011034]
help
Chatterbox?
[choroba]: 22 points until level 22
[Eily]: I guess your about to turn 22 yourself then choroba :P
[Eily]: in 22 days
[ww]: 22 hrs and 22.22 minutes?
[choroba]: 22? Heh, that's... almost 22 years ago :-)
[Corion]: :-D

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2017-09-25 14:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (280 votes). Check out past polls.

    Notices?