beethamd has asked for the wisdom of the Perl Monks concerning the following question:
David$date = $4.$3.$2; if (eval("\%$date")) { print "<TD class=table_font>$date - Hash exists</TD>\n"; # play with hash } else { print "<TD class=table_font>$date - Hash doesn't exist</TD>\n"; # create the hash eval("\%$date = ()"); # play with hash }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Dynamically creating a hash based on a variable
by Joost (Canon) on Apr 15, 2007 at 13:54 UTC | |
by beethamd (Initiate) on Apr 15, 2007 at 14:02 UTC | |
|
Re: Dynamically creating a hash based on a variable
by cdarke (Prior) on Apr 15, 2007 at 13:54 UTC | |
by beethamd (Initiate) on Apr 15, 2007 at 14:13 UTC | |
|
Re: Dynamically creating a hash based on a variable
by GrandFather (Saint) on Apr 15, 2007 at 13:57 UTC | |
|
Re: Dynamically creating a hash based on a variable
by naikonta (Curate) on Apr 15, 2007 at 16:36 UTC |