foobarrior has asked for the wisdom of the Perl Monks concerning the following question:
I just gotuse warnings; use strict; open @$_ for ([\*STDIN, '< input.txt'], [\*STDOUT, '> output.txt']);
Can't use string ("2") as a symbol ref while "strict refs" in use at a.pl line 4.
But passing by one element works perfectly:But I think it looks ugly. Is there some way to do what I want?open $_->[0], $_->[1], $_->[2] for ([\*STDIN, '< input.txt'], [\*STDOUT, '> output.txt']);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Pitfalls met while opening multiple files
by moritz (Cardinal) on Jul 24, 2011 at 16:45 UTC | |
by armstd (Friar) on Jul 24, 2011 at 23:24 UTC | |
Re: Pitfalls met while opening multiple files
by chrestomanci (Priest) on Jul 24, 2011 at 17:05 UTC | |
Re: Pitfalls met while opening multiple files
by armstd (Friar) on Jul 24, 2011 at 16:08 UTC |