The code from class is copied below.
#!/usr/bin/perl
use strict;
use warnings;
open(INPUT, 'input.txt') or
die "Could not open 'input.txt': $!\n";
open(OUTPUT, '>', 'output.txt') or
die "Could not open 'output.txt': $!\n";
my $number = 1;
while (my $line = <INPUT>) {
print OUTPUT "$number: $line";
$number++;
}
close(INPUT);
close(OUTPUT);