http://qs321.pair.com?node_id=549166


in reply to Proof of concept: File::Index

Instead of creating indexes, we could use the indexed array already available in BerkeleyDB using the recno structure; then, we walk along the cursor from any desired line_num. The database, of course, is always update-table.

This command constructs such Recno database from our given text file: cat foo.txt | db4.3_load -T -t recno bar.db

Although simple, the command above needs further refinement if we are unsatisfied with the default definition of newline, with the escaping of inserted text, or problems due to binary input. (See db4.3_load(1) )