Think about Loose Coupling | |
PerlMonks |
Getting filename from IO::File objectby arunhorne (Pilgrim) |
on Jan 30, 2003 at 11:56 UTC ( [id://231280]=perlquestion: print w/replies, xml ) | Need Help?? |
arunhorne has asked for the wisdom of the Perl Monks concerning the following question: I am subclassing the Graph::Writer module to provide output for a new graph format and must work within the confines of the following function.
The function receives a file handle (IO::File=GLOB(0x8333a68)) to a single file ($FILE). However, I need to create two output files for this graph format and thus I need to get the filename from the $FILE file handle and use this as the base name from which I can generate two new filenames and open these for output (and close $FILE). I know this is a bit of a kludge, but I'm within the confines of original function that is being overriden. How can I do this, or has anyone got a better idea how I could do it without changing the parameters accepted by the function?
Note that I need concurrent access to the two new files rather than sequential so will need two open file handles at once. Thanks, Arun ____________Arun
Back to
Seekers of Perl Wisdom
|
|