my $fill_char = " "; my $string = $fill_char x $nr_of_bytes; open FW, ... ; print FW $string; close FW;