in reply to Can't use string (">> /$1/$2/figs/Com/dis") as a symbol ref while "strict refs" in use
Use 3 parameter form of open, and watch your parenthesis.
my $file = "/$1/$2/figs/Com/dis/result.xml"; open RESULT, '>>', $file or die "Can't open $file: $!"; select(RESULT);
Also note that you should include your select statement within your if, as there's not point in selecting a file handle if you don't actually open it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Can't use string (">> /$1/$2/figs/Com/dis") as a symbol ref while "strict refs" in use
by tchrist (Pilgrim) on May 03, 2011 at 05:41 UTC | |
by wind (Priest) on May 03, 2011 at 09:55 UTC |