Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Accessing the hash name in perlby Discipulus (Canon) |
on Mar 23, 2017 at 08:11 UTC ( [id://1185564]=note: print w/replies, xml ) | Need Help?? |
Hello Sonali NB this was a reply of yesterday when you had no other useful answers you now have. I put this even if later to add some general consideration. The first one is: generally speaking when you need to know a variable name (what it is after the $ sigil) you are in the wrong direction. There are two distinct concepts (in regard to retrieve variable from external source): parsing and importing. While the first read some file and based on the content of such file populate some variable the latter (that behind the scene do the same thing) put in the current namespace variable from an external source. Manually do the parsing is generally error prone. There are different options to save perl datastructure into a file for a later retrieve: you can use Data::Dump output, or Storable Yaml but see the detailed replies about haw muche they are safe. The very precise monk afoken (read his reply carefully) wrote a useful comparison about different methods of storing/retrieving Perl datastructure: read the thread Data::Dumper JSON Storable YAML differences L*
There are no rules, there are no thumbs.. Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
In Section
Seekers of Perl Wisdom
|
|