in reply to Re: substitue variables from file
in thread substitue variables from file

Hi Bart, The reference article you sent resolved the problem with the s/\$(\w+)/${$1}/g Many thanks !!! azaria

Replies are listed 'Best First'.
Re^3: substitue variables from file
by dragonchild (Archbishop) on Oct 30, 2005 at 02:15 UTC
    You don't want to do that. Look up "symbolic references" or "soft references" for more information as to why. For one thing, they won't do variables that have been declared with my, as you would usually do under strictures.

    Much better is to have a hash that contains all the variable names you wish your file to be allowed to used. Then, you would do s/\$(\w+)/$hash{$1}/g;


    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?