How to declare a var hash name ?

Discussion in 'Perl Misc' started by Nicolas Printemps, Nov 22, 2006.

  1. Hello,

    Which synthax to use to declare a variable hashname ?

    $tempo="popo"

    my %$popo; does not seem to work..

    Regards
    Nicolas Printemps, Nov 22, 2006
    #1
    1. Advertising

  2. Nicolas Printemps

    Paul Lalli Guest

    Nicolas Printemps wrote:
    > Which synthax to use to declare a variable hashname ?
    >
    > $tempo="popo"
    >
    > my %$popo; does not seem to work..


    Nor should it.

    What makes you think you want to do this? What is your *actual* goal,
    that you think "variable hashname" is the solution to?

    Have you read:
    perldoc -q "variable name"
    ?

    Paul Lalli
    Paul Lalli, Nov 22, 2006
    #2
    1. Advertising

  3. Nicolas Printemps

    John Bokma Guest

    Nicolas Printemps <> wrote:

    > Hello,
    >
    > Which synthax to use to declare a variable hashname ?
    >
    > $tempo="popo"
    >
    > my %$popo; does not seem to work..


    What's wrong with:

    my %tempo;

    and using

    $tempo{ popo }{ key } = some value;

    --
    John Experienced Perl programmer: http://castleamber.com/

    Perl help, tutorials, and examples: http://johnbokma.com/perl/
    John Bokma, Nov 22, 2006
    #3
  4. sorry

    %$tempo does not seem to work.

    I would like to declare a certain number a hashes that are included into
    a list.
    Nicolas Printemps, Nov 22, 2006
    #4
  5. Nicolas Printemps

    Paul Lalli Guest

    Nicolas Printemps wrote:
    > sorry


    For what?

    > %$tempo does not seem to work.


    No. It doesn't. We've already established that.

    > I would like to declare a certain number a hashes that are included into
    > a list.


    WHY!!!!???

    Answer that question, and we can tell you how to do it correctly! Stop
    ignoring our responses in favor of just repeating your question!

    Are you at all aware that perl has multi-dimensional structures?
    Please read:
    perldoc perlreftut
    perldoc perldsc

    Paul Lalli
    Paul Lalli, Nov 22, 2006
    #5
  6. Nicolas Printemps wrote:
    > sorry
    >
    > %$tempo does not seem to work.
    >
    > I would like to declare a certain number a hashes that are included
    > into a list.


    Ok. What's blocking you from using an AoH aka ArrayOfHash or more accurately
    array of hash references?

    jue
    Jürgen Exner, Nov 22, 2006
    #6
  7. I will check. Thank you
    Nicolas Printemps, Nov 22, 2006
    #7
  8. Nicolas Printemps

    Keith Keller Guest

    On 2006-11-22, Nicolas Printemps <> wrote:
    > I will check. Thank you
    >
    >
    >


    You will check what?!? Please quote context so that others know what
    you are talking about.

    --keith


    --
    -francisco.ca.us
    (try just my userid to email me)
    AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
    see X- headers for PGP signature information
    Keith Keller, Nov 22, 2006
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. macm
    Replies:
    1
    Views:
    205
    Ian Kelly
    Nov 11, 2010
  2. rp
    Replies:
    1
    Views:
    512
    red floyd
    Nov 10, 2011
  3. Une bévue
    Replies:
    5
    Views:
    146
    Une bévue
    Aug 10, 2006
  4. kenneth
    Replies:
    1
    Views:
    121
    Gunnar Hjalmarsson
    Dec 11, 2004
  5. Jang
    Replies:
    1
    Views:
    91
Loading...

Share This Page