in reply to 'strict refs' + 'strict sub' = suck.
use strict; use IO::File; my $f = new IO::File "filetoread.something", "r" or die "Can not open input file"; while (<$f>) { # do stuff ... } undef $f; # close the file # note that you don't even have to do this # this is optional because the file will be # closed when Perl script finishes. I am just # forcing an early file closure here.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: 'strict refs' + 'strict sub' = suck.
by chromatic (Archbishop) on Oct 25, 2003 at 17:39 UTC | |
|
Re: Re: 'strict refs' + 'strict sub' = suck.
by vek (Prior) on Oct 25, 2003 at 20:52 UTC | |
by Roger (Parson) on Oct 26, 2003 at 00:05 UTC |