in reply to Sensing of Null character

Since you haven't asked any question, I can only assume it is "how do I remove a trailing Null character?".

If that's the case, you have several options:

{ local $/ = chr 0; chomp $your_string; } # or $your_string =~ s/\x00\z//;

See $/ and perlretut.

I'm sure there are even more possibilites.