#!/usr/bin/perl -w use strict; my $in_file = shift @ARGV; open(INFILE, "$in_file") or die "Can't open input file!: $!\n"; while () { # do stuff with each line of INFILE until # there are no more lines to process } close(INFILE);