in reply to Re: Looking for a hexadecimal byte string in a scalar variable
in thread Looking for a hexadecimal byte string in a scalar variable

You're going to need to use the '^' anchor, e.g.
if ($chunk =~ /^\xff\xff\x08\x00/) { print "Chunk in use\n"; } else { print "Chunk not used\n"; }
Otherwise, you'll get a match if that byte sequence is anywhere in the chunk, not just in the beginning.
  • Comment on Re: Re: Looking for a hexadecimal byte string in a scalar variable
  • Download Code