Yes, but the second part of s/// is never reached, since the first part of s/// does not match. It would work, if the first part match!.
| [reply] |
Which is ok because I'm saying in the s/// "if you find the time of day replace it with this hash value". If it doesn't find it it won't do anything, right? I guess my question was can't I access a hash from within a reg like this s/whatever/$clocks{$PRTABLE}/; If your answer is yes you can then I'm messing up the logic somewhere, or maybe I can't use that kind of reg and variable combination. I just don't understand why s/// replaces a blank but with print it give me the correct value.
| [reply] |
$ perl5.8 -e '$x = "a b c d"; $a = "blah"; $b{$a} = "foo"; $x =~ s/a b
+/$b{$a}/; print "$x\n"'
foo c d
Works fine here ... so, yes, there's something incomplete here. Perhaps you should post a complete test line that you expect to be modified by all of this so we can take a closer look. | [reply] [d/l] |