Further to the comments from hippo and afoken, I'm a little puzzled by your input (when downloaded) and your expected output as the alignment seems inconsistent. Have you perhaps pasted some TAB characters in there?
Regarding your code:-
Use of lexical rather than package file handles is now recommended and I would suggest that the error messages on open failure be differentiated with the file name so that you know immediately which failed rather than having to do some detective work.
Your
while (<FILE>) {
$line = $_;
could more simply be written
while ( my $line = <FILE> ) {
You pad the line to a length of 280 characters but you have forgotten to chomp the line terminator off before padding so you have a line terminator left in the middle.
A simpler way to pad lines with spaces is to use pack with the A template, for example:-
johngg@shiraz:~/perl/Monks > perl -Mstrict -Mwarnings -E '
my $text = q{abcd};
say qq{>$text<};
$text = pack q{A10}, $text;
say qq{>$text<};'
>abcd<
>abcd <
johngg@shiraz:~/perl/Monks > perl -Mstrict -Mwarnings -E '
my $text = q{abcd};
say qq{>$text<};
$text = pack q{A2}, $text;
say qq{>$text<};'
>abcd<
>ab<
Rather than unpacking into several scalars do so into an array and then apply double quotes to the relevant items using an array slice, something like this:-
johngg@shiraz:~/perl/Monks > perl -Mstrict -Mwarnings -E '
my @items = q{a} .. q{g};
s{(.*)}{"$1"} for @items[ 0, 1, 3, 5, 6];
say for @items;'
"a"
"b"
c
"d"
e
"f"
"g"
Rather than multiple print statements, perhaps use a single say (if running perl 5.10 or later) and join all the items together with commas in one fell swoop, something like
say join q{,}, @items;
I hope these pointers are helpful and you are able to move towards a solution. Please ask further if difficulties persist.