How to declare a var hash name ?

N

Nicolas Printemps

Hello,

Which synthax to use to declare a variable hashname ?

$tempo="popo"

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

Regards
 
P

Paul Lalli

Nicolas said:
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
 
J

John Bokma

Nicolas Printemps said:
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;
 
N

Nicolas Printemps

sorry

%$tempo does not seem to work.

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

Paul Lalli

Nicolas said:

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
 
J

Jürgen Exner

Nicolas said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top