talexb has asked for the wisdom of the Perl Monks concerning the following question:
This is frustrating but I can't figure out why it isn't working. I want to replace $1 (the full file name) with whatever the root file name ($2) maps to, based on information stored in a hash. If the mapping doesn't exist, I want to display that result instead.
So why do I gets/$1/exists($hash{$2}) ? $hash{$2} : "$2:mapping not done"/e;
I expected instead for the !defined condition to trigger the 'mapping not done' string.Use of uninitialized value in concatenation (.) or string
The variable %hash is currently empty. I plan to populate it as I go through the files.
Hand is open and facing forehead, ready to move ..
--t. alex
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using 'e' in s///
by chromatic (Archbishop) on Aug 13, 2003 at 20:50 UTC | |
by talexb (Chancellor) on Aug 13, 2003 at 20:52 UTC | |
|
Re: Using 'e' in s///
by hardburn (Abbot) on Aug 13, 2003 at 20:51 UTC | |
|
Re: Using 'e' in s///
by Aristotle (Chancellor) on Aug 14, 2003 at 00:57 UTC | |
by sauoq (Abbot) on Aug 14, 2003 at 01:04 UTC |