I'm having a bit of trouble with tracking my filehandles and wonder if anyone might have some suggestions.
I'm working on a system that tails a number of web logs and I need to be able to associate each of the filehandles with a domain name so I can know the domain when I get a line of input. Therefore, I need some way to map the filehandle back to the domain name.
All the handles are implemented as IO::File objects. I tried stashing the domain name in there but it appears that it is implemented as a typeglob so I can't hide anything in there.
At the moment, I've got the thing rigged with a hash with the IO::File objects as keys and the domain names as values. It is my understanding that, in this usage, the filehandle would be reduced to a scalar before being turned into a key. This strikes me as a very bad way to do things but I'm at a total loss as to what to do. Any ideas?
An 8 bit man in a 32 bit world.
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.