PhosphoricX has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to perform a subsitution if an entry exists in my hash:
s/(\$\w+)/$variables{$1}/g if(exists $variables{$1};
How can I assure that a match, not found in my hash will not be replaced?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Substitutions if hash entry exists
by Tomte (Priest) on Mar 19, 2004 at 10:32 UTC | |
|
Re: Substitutions if hash entry exists
by bart (Canon) on Mar 19, 2004 at 10:34 UTC | |
|
Re: Substitutions if hash entry exists
by PhosphoricX (Sexton) on Mar 19, 2004 at 11:16 UTC |