Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Comment on

by gods
on Feb 11, 2000 at 00:06 UTC ( #3333=superdoc: print w/replies, xml ) Need Help??

"Seem to" dominate? The very meaning of the name of Perl suggests it would be predominately focused on sequential text files.

That said, and DBM::Deep already mentioned, if you want to spin your own module to support what we in the dinosaur days would have called Fixed-Length Random Access File processes, you could look into the following features of Perl:

Input and output functions:

  • binmode
  • read
  • seek
  • sysread
  • sysseek
  • syswrite
  • tell
  • write

Modern data processing (is that an oxymoron?) thinks more in terms of XML and DB for re-usable, rewriteable data; but if you must play in the old fashioned fixed-length random-access file space, the above tools will readily permit migration of your old C code where you last reinvented that wheel to Perl where you seem fixated on this somewhat dated approach to data storage.

:-)

All that having been said, I myself could not resist the urge to port my old FLRAF routines to Perl when I first got here. I never bothered to write a module I would dare to put in front of other software engineers, however, since I knew going into the effort it was an exercise to produce a tool I was unlikely to ever need.

DBI/SQLite has been a good friend:

use DBI; my $dbargs = { AutoCommit => 0, PrintError => 1 }; my $dbscns = "dbi:SQLite:dbname=$Db_dbn"; &debug::debug("\$dbscns = '$dbscns\n"); my $dbshan = DBI->connect($dbscns,"","",$dbargs); &debug::debug("\$dbshan = '$dbshan'\n");
Updated to computerize DBM::Deep

In reply to Re: File I/O structure by marinersk
in thread File I/O structure by silverbullet

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others making s'mores by the fire in the courtyard of the Monastery: (5)
    As of 2016-10-01 18:36 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      How many different varieties (color, size, etc) of socks do you have in your sock drawer?






      Results (4 votes). Check out past polls.