in reply to Looking for a hexadecimal byte string in a scalar variable

Question : comparison of what to what? I'm not sure I get it. My take is that you want to see whether the first four bytes of $string are the hex values you describe.

Probably, what you want is to use pack on the array ('FF','FF','08','00') and compare the result to the first four bytes of that string, which you can extract with substr, to wit:

my $signal = pack ('H4', qw(ff ff 08 00)); #stuff if ( substr($string, 0, 4) eq $signal ) { # it's in use }

Note, the upper case H in the pack is significant, it says the high nybble goes first. Try it with a lower-case h if you're getting wacky results.

Philosophy can be made out of anything. Or less -- Jerry A. Fodor