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.
#!/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, &GDBM_READER, 0400 or die "Couldn +'t tie NDBM file 'filename': $!; aborting"; untie %DBMDB;
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
In reply to GDBM_File with Tie function by bheeshmaraja
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |