use strict; use warnings; my $file_in = "C:/Users/Joe/Documents/Genealogy/birdt.ged"; open my $FILE, "<", $file_in or die "could not open $file_in $!"; while ( my $line = <$FILE> ) { print "$. $line"; } close $FILE or die "could not close $file_in $!"; __END__ #### use strict; use warnings; use Path::Tiny; # imports path() my $file_in = "C:/Users/Joe/Documents/Genealogy/birdt.ged"; my $line_num = 0; for my $line ( path( $file_in )->lines ) { print sprintf '%4d %s', ++$line_num, $line; } __END__