<?xml version="1.0" encoding="windows-1252"?>
<node id="999492" title="GDBM_File with Tie function" created="2012-10-17 04:49:38" updated="2012-10-17 04:49:38">
<type id="115">
perlquestion</type>
<author id="912147">
bheeshmaraja</author>
<data>
<field name="doctext">
&lt;p&gt; I have a simple getdata perl script which is used to get users First Name, Last Name and their email details. I'm getting these details from a file(test.txt). test.txt has  25 fields separated by "|" delimiter and I'm getting only 3 fields using my getdata script. I couldn't understand the behavior of this script. I need help in understanding the below script.&lt;/p&gt;

&lt;code&gt;
#!/opt/perl/5.8.0/bin/perl
#ident "%W%"
use CGI qw(:standard);
use GDBM_File ;
use POSIX qw(fcntl_h errno_h);
use Getopt::Std;
use Fcntl;

$dbfile_exist = "no";

$arg1 = $ARGV[0]; # Argument 1 is the User ID.

$dbmdatabase = "/home/bheeshmaraja/test.txt";

if (-f "$dbmdatabase") {
        $dbfile_exist = "yes";
} else {
        print "NULL";
        exit 0;
}

tie %DBMDB, GDBM_File, $dbmdatabase, &amp;GDBM_READER, 0400 or die "Couldn't tie NDBM file 'filename': $!; aborting";

untie %DBMDB;

&lt;/code&gt;

&lt;p&gt; test.txt contains 5176219 lines. Could anyone help me to understand why I'm getting only 3 fields instead of all 25 fields by providing User Id as an argument. Thanks in Advance... Bheeshmaraja &lt;/p&gt;
</field>
</data>
</node>
