Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^5: variable as hash name

by Tux (Abbot)
on Dec 08, 2012 at 09:58 UTC ( #1007879=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %all_my_hashes;
    
    ...
    $all_my_hashes{Bet01} = { 230 => 2, 238 => 5, 224 => 1, };
    $all_my_hashes{Bet05} = { 101 => 2, 103 => 2,   0 => 4, };
    
  2. or download this
    %$foo = ( 1, 2, ... );
    
    ...
    
    my %all_my_hashes;
    $all_my_hashes{$foo} = { 1 => 2, ... };
    
  3. or download this
    my $all_my_hashes;
    $all_my_hashes->{$foo} = { 1 => 2, ... };
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1007879]
help
Chatterbox?
[Discipulus]: while (readdir DIR) was wrong too; it is while ($_ = readdir DIR)
[Corion]: Discipulus: I have to admit that nowadays I either use Path::Class or use File::Find or simply File::Glob:: bsd_glob to read a directory, depending on how fancy my needs are
[shmem]: Discipulus: while (readdir DIR) works fine
[Discipulus]: Eataly vs World(coffe) ;=)
[Discipulus]: shemem i wrote it directly.. but when i tested it i got a lot of 'undefined value..'

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2017-05-26 07:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?