Random record access

M

Monty

Is there a strategy in Perl to randomly access a file of variable-
length records?

Thanks
 
X

xhoster

Monty said:
Is there a strategy in Perl to randomly access a file of variable-
length records?

Many. "seek" and "tell". Tie::File (and many other Tie modules, I'm
sure). All kinds of *DB* modules, like DB_File and DBM::Deep.

And of course you could just slurp the file into an array or a hash,
if it isn't too big.

Xho
 
M

Monty

The file could get big, so loading it up into memory probably isn't a
good idea. I forgot to mention that it's a text file, so I wonder if
that makes a difference. In the meantime I'll look into those
possibilities you gave me.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top