in reply to Using regexp with binary data

Use $data =~ /$_/s instead of $data =~ /$_/ and then it's OK!