citycrew has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I am using following tie process to load large files into an array. Some of the files will be over a gig so I don't want any mem usage at all. I want to confirm that referencing $ra_list->[0] will not recreate the list into memory at all. I know that it won't on a standard array ref but this is a tie::file and I don't know if they work differently in that respect.
my $ra_list = getList(); my $line1 = $ra_list->[0]; sub getList { my @list; tie(@list, 'Tie::File', '/path/file', memory => 0, mode => O_RDONLY) +; return \@list; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Referencing a Tie::File Array
by ikegami (Patriarch) on Oct 01, 2011 at 01:21 UTC | |
by citycrew (Acolyte) on Oct 01, 2011 at 02:38 UTC | |
by ikegami (Patriarch) on Oct 01, 2011 at 03:32 UTC |