gomez18 has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Storing metadata with file handles
by blakem (Monsignor) on Oct 04, 2002 at 18:43 UTC | |
by gomez18 (Sexton) on Oct 04, 2002 at 18:54 UTC | |
by blakem (Monsignor) on Oct 04, 2002 at 19:02 UTC | |
|
Re: Storing metadata with file handles
by kabel (Chaplain) on Oct 04, 2002 at 18:39 UTC |