in reply to FILE operation in PERL
There are two approaches.
my @lines = <FILE>; will read from an open file handle into an array.
Update: tilly pointed out that it's also possible to re-read the file. You can do that by closing and reopening the file (which assumes that the file hasn't been rewritten in the interim), or you can rewind the file handle.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: FILE operation in PERL
by ramesh_nathan (Initiate) on Jul 19, 2003 at 08:16 UTC | |
by dws (Chancellor) on Jul 19, 2003 at 08:18 UTC | |
by ramesh_nathan (Initiate) on Jul 19, 2003 at 08:20 UTC | |
by BrowserUk (Patriarch) on Jul 19, 2003 at 12:32 UTC |