#!/usr/bin/perl -w use strict; open (FILE, "file.txt") or die "arrrrgh...$!\n"; while () { print; # pass to program here } close(FILE);