while () { local $" = ', '; my @positions; push @positions, pos() while /\000/g; print 'Found nulls at line ', $. , ', positions ' "@positions.$/" if @positions; }