I have a data file that looks like this:
012101 013004 1.44 3.15 9.50 10.83 15.58 12.41
012101 020002 1.38 3.33 528.14 8.70 12.77 20.63
012101 023003 2.53 7.45 3.55 7.28 5.26 17.61
012101 030002 1.59 6.00 9.09 7.26 7.36 36.02
012101 040002 1.44 3.04 2.65 9.30 9.43 30.24
I've done some more looking into this and discovered 'perldoc perllol'.
Using the example from there, here's what I've done:
#!/usr/bin/perl -w
$datafile='/home/users/cajun/perl/wwwstats/wwwstats.data';
open(INFILE,"$datafile") || die "Cannot open $datafile :$!";
while(<INFILE>){
@tmp=split(0..7);
push @AoA, [@tmp];
print $AoA[5][3];
}
close INFILE;
When I run this, I get lots of :
Use of uninitialized value in print at ./r-wwwStats.pl line 13, <INFILE> line 1.
Use of uninitialized value in print at ./r-wwwStats.pl line 13, <INFILE> line 2.
Use of uninitialized value in print at ./r-wwwStats.pl line 13, <INFILE> line 3.
Use of uninitialized value in print at ./r-wwwStats.pl line 13, <INFILE> line 4.
So obviously, I'm still missing some piece of the puzzle somewhere. Pointers greatly appreciated !
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, details, 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, summary, 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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.