in reply to Re^5: replace with hash value?!
in thread replace with hash value?!

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.

Replies are listed 'Best First'.
Re^7: replace with hash value?!
by Tanktalus (Canon) on Jan 19, 2005 at 16:42 UTC

    "replaces a blank" (or, "replaces with a blank", I assume you mean). That's very pertinant information. Something is fishy there:

    $ 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.

      Your test script worked ok.??