#!/usr/local/bin/perl -w use strict; my $flipped=0; sub logit { my $line=shift; $line=~s/\0//g; return unless ($flipped or ($line=~/\S/ and ++$flipped)); print $line; } while () {&logit ($_)} __DATA__ we dont really need this again but here it is anyway