in reply to blank lines up to a point

Why do you need the s/\0//g btw? If you can get away without that then you can get the logit() sub down to:
sub logit{ print OUTF if (/\S/..0); }
Works the same way just without being so verbose.