in reply to Hex string search all files in directory

I think you are overwriting the results for each file, "test.txt" is just the last one in the alphabet.

What happens if you change

open (HEX_OUT, ">>", $hex_out") or die "$!";

to append instead of overwriting? Or even better you move it before the loop?

Why don't you use warnings?

BTW: proper indentation would facilitate reading your code =)

Cheers Rolf

PS:why do you escape the h in /\hello/?