in reply to Problems writing to filehandles contained in variables
withmy @incHandles = (*INCNT, *INCMAIL, *INCUNIX);
it'll start to work. But the proper answer is to use IO::File objects, to keep you from even having to mention names for things that are never again referred as names:my @incHandles = (\*INCNT, \*INCMAIL, \*INCUNIX);
And if you're using a fairly recent version of Perl, you can even skip those last two steps. Simply using an undef var as if it was a filehandle autovivs as a filehandle! Cool!my @incHandles; use IO::File; push @incHandles, IO::File->new for 1..3;
-- Randal L. Schwartz, Perl hacker
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re: Problems writing to filehandles contained in variables
by tye (Sage) on Aug 11, 2002 at 00:59 UTC |