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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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
Outside of code tags, you may need to use entities for some characters:
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
|
|