Reading from the Filehandle
#!/usr/bin/perl open(FILE, "data.txt") || die "Can't open data.txt: $!\n"; while(<FILE>) { print if /A/; } close(FILE);