Try this:
The reason you can do this is because while will read the file handle one line at a time. I am wondering what you mean by "passing it to another program." Could you just use a subroutine, or are you talking about a seperate utility? redmist#!/usr/bin/perl -w use strict; open (FILE, "file.txt") or die "arrrrgh...$!\n"; while (<FILE>) { print; # pass to program here } close(FILE);
In reply to (redmist) Re: Reading a file
by redmist
in thread Reading a file
by ep
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |