Your code
if ($Line =~ /\000/) is searching within the
$Line variable, however, I don't think that's what you want. You want to match within
$CurrentLine, right?
if ($CurrentLine =~ /\000/). However, if all you want to do is find the string offset of a single character, use the
index function, which will be much more efficient.
blokhead