in reply to 'do' read file
do will not alter lexical ('my') variables in the outer scope. To achieve this you have to use a package variable, so delare it using our.
However, using a file to set your variables can be dangerous, think carefully if you really need to do that. Why not put the keys/values into a file, read it in the normal way, and construct the hash yourself?
However, using a file to set your variables can be dangerous, think carefully if you really need to do that. Why not put the keys/values into a file, read it in the normal way, and construct the hash yourself?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: 'do' read file
by PhillipHuang (Beadle) on Dec 14, 2011 at 09:13 UTC |
In Section
Seekers of Perl Wisdom