in reply to Re: Having a "default" hash value!
in thread Having a "default" hash value!

Ah, well, I got that escape code from Term::Color actually :) Dont ask me why its like that, but it works... I dont get the left bracket either... there was no right bracket in the code in that module either. Also, the code is just part of a bigger hash, where I also have \e[32m \e[33m etc... counting up to 47 or so...

Replies are listed 'Best First'.
Re^3: Having a "default" hash value!
by graff (Chancellor) on Mar 03, 2006 at 08:05 UTC
    My comment about "deleting the right angle bracket" was not about the escape codes, which always use a single left-square bracket after the ascii "esc" character, because... well, whoever thought it up must have felt it was a good idea at the time.

    I was pointing out that your regex substitution went like this:

    s/(^.*<)\:([a-z]+)>/$1$hash{$2}/;
    Note that you are keeping the left-angle bracket ("<") as part of the first capture ($1), but you are not keeping the associated right-angle bracket (">") -- that one is being deleted, because it's part of the matched pattern, but not part of the replacement string.

    If that's what you want, fine. I just thought it looked a bit like a bug.

      Ah. Sorry then. Well, the code is somewhat modified from the original, so I may have missed something...