Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Accessing the hash name in perl

by Discipulus (Canon)
on Mar 23, 2017 at 08:11 UTC ( [id://1185564]=note: print w/replies, xml ) Need Help??


in reply to Accessing the hash name in perl

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1185564]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-24 04:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found