anjali has asked for the wisdom of the Perl Monks concerning the following question:

Hi,
Here is the code.For node no. I gave some no.s but no use. I have to know the content of this tes.db file.
use Fcntl; use DB_File; tie(@file, 'DB_File', "C:/Prac/tes.db", O_RDWR, 293359, $DB_RECNO) or +die "can't update /tmp/sample: $!"; print "line #1 was ", $file[1], "\n"; untie @file;
Thanks.

Replies are listed 'Best First'.
Re: Perl (Berkeley DB)
by simonm (Vicar) on Dec 08, 2003 at 07:45 UTC
    It sounds like you might want the BerkeleyDB module. Read the manpage for examples of opening and reading from such a file.
Re: Perl (Berkeley DB)
by Roger (Parson) on Dec 08, 2003 at 06:42 UTC
    Hello anjali, and welcome to the Perl Monastery.

    Can you please post a fragment of the code you are working on, so monks can have a look at what you have done so far, that may help us to help you better.

      Hi,
      Here is the code.For node no. I gave some no.s but no use. I have to know the content of this tes.db file.
      use Fcntl; use DB_File; tie(@file, 'DB_File', "C:/Prac/tes.db", O_RDWR, 293359, $DB_RECNO) or die "can't update /tmp/sample: $!"; print "line #1 was ", $file[1], "\n"; untie @file;
      Thanks.
        Hi anjali, can you please post your database file here as well. You can follow the procedure below to post the database file (I know your database file is only 12K or something):

      • ZIP up the db file
      • Download the free UUENCODE and UUDECODE utilities for Windows here
      • uuencode the ZIP'ed file with uuencode mydata.zip mydata.txt
      • Cut & paste the uuencoded text in a new follow-up post, or update your existing node.

Re: Perl (Berkeley DB)
by xenchu (Friar) on Dec 08, 2003 at 15:15 UTC
    Hi Anjali,

    Before you post again would you please readWriteup Formatting Tips. Using the 'code' tags will make programs, etc. much easier to read.

    Thanks,

    xenchu

    PS. Welcome to Perl Mongers!



    ****sigfilesigfilesigfilesigfilesigfilesigfilesigfilesigfile

    Perl has one Great Advantage and one Great Disadvantage:

    It is very easy to write a complex and powerful program in three lines of code.

    ********************************************

    The Needs of the World and my Talents run parallel to infinity.