The traditional approach is to just use the filehandle twice:
sub openOut { select *main::OUT = *main::OUT; # squelch "used once" warning ...
Alternatively, you can disable the warning, see warnings:
sub openOut { { no warnings 'once'; select *main::OUT; } ...
The best approach IMO would be to do away with the global filehandle names alltogether and pass in the filehandle from the main program. but I guess that's beyond the scope of your question :)
In reply to Re: How to suppress "only used once" regarding script file handles (that are in fact used in my module), but do it from a the module?
by Corion
in thread How to suppress "only used once" regarding script file handles (that are in fact used in my module), but do it from a the module?
by hepcat72
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |