Code Snippets

#!/usr/bin/perl
use strict;
use warnings;

open(my $fh, '<', 'data.txt') or die "Cannot open data.txt: $!";
while (my $line = <$fh>) {
    chomp $line;
    print "$line\n";
}
close($fh);