Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: what is the purpose of Tie::File

by afoken (Abbot)
on Nov 10, 2012 at 19:23 UTC ( #1003273=note: print w/replies, xml ) Need Help??

in reply to what is the purpose of Tie::File

Did you even try to read the documentation of Tie::File?

Tie::File represents a regular text file as a Perl array. Each element in the array corresponds to a record in the file. The first line of the file is element 0 of the array; the second line is element 1, and so on.

The file is not loaded into memory, so this will work even for gigantic files.

Changes to the array are reflected in the file immediately.

Lazy people and beginners may now stop reading the manual.

Tie::File has its uses, but of course it introduces some overhead. For some manipulations, the overhead can become a real performance killer.


Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^2: what is the purpose of Tie::File
by Lotus1 (Curate) on Nov 11, 2012 at 00:19 UTC
    Did you even try to read the documentation...

    This question tells me you didn't even try to read what I posted, just the title. It probably wasn't the best title for this node but it was the question I had been wondering until this morning.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1003273]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (3)
As of 2018-06-23 22:49 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.