It's going to be a tad difficult to figure out what's going on without enough data (a sample of the input file, say). It may well be that you're getting 1 element because that's all there is.
There are some stylistic issues with your code:
- $_ =~ /$ARGV[0]/ is equivalent to the more usual /$ARGV[0]/. If $ARGV[0] can contain metacharacters (backslash, periods, etc), it probably should be quoted.
- if($tfl_contents[9] ne "") (you did have a null string, no?) may be better written as if($tfl_contents[9]).
added in update
As chromatic notes, in his response, replacing
if($tfl_contents[9] ne "")
with
if($tfl_contents[9])
may also be worse, e.g. if there's a 0 in that location.
emc
At that time [1909] the chief engineer was almost always the chief test pilot as well. That had the fortunate result of eliminating poor engineering early in aviation.
—Igor Sikorsky, reported in
AOPA Pilot magazine February 2003.
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.