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.
sub _write_graph { my $self = shift; my $graph = shift; my $FILE = shift; #while (<$FILE>) #{ #} return 1; }
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
____________In reply to Getting filename from IO::File object by arunhorne
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |