That's higly inefficient. For each line read via
INFILE1,
you iterate over all the lines of the previously read filehandle
INFILE2, and you are doing all the substring mumbo jumbo
again and again.
It seems from your if condition, that you are only interested
in ($date, $number_dialed, $connect_time).
A better approach seems to be:
- read all lines from INFILE2 in a loop and e.g. concatenate
them
- stuff the result in a hash, using the concatenation result as a key
- then, while reading INFILE1, construct a key in the same
manner, and look up this key in the previously built hash.
If the storage needed for building the hash in the first place
(reading INFILE2) surpasses your workstation's memory ressources,
store them in e.g. a DB_File or DBD::SQLite database.
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
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.