in reply to Pattern match not working sometimes

A minor thing: why do you look for (.*)$ ? If you don't want to do anything with the junk after the 4 characters, use only /^(\C\C\C\C)/

Replies are listed 'Best First'.
Re^2: Pattern match not working sometimes
by tobyink (Canon) on Mar 18, 2012 at 20:28 UTC

    At a guess, the stuff which is done in the place of the #Do some stuff comment uses $2.

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
      Very true, I am using both within that block.
        One thing I forgot to mention is that this is binary data, not "characters" if it makes a difference.
        One thing I forgot to mention is that this is binary data, not "characters" if it makes a difference.