If so, I'm not sure that the benefit of using a lexically scoped file handle is worth the hassle if the code still has to run on older perl versions. Do you have some compelling reason for needing to use a lexically scoped file handle?
OTOH, if the goal is "open the file this way if perl is > 5.007 and open it the old way otherwise", that would be a really bad idea, because then you'd have to check the version and use eval every time you write to the file handle. Don't do that.
UPDATE: Apologies again... I just noticed this bit:
(Changing the open call to a 2 argument form is not a viable solution :-)
This seems to answer my first question -- no way you would want to open the file if running under an older version (which does not support 3-arg open). Perhaps you could elaborate on why a 2-arg open is not viable, and how that relates to the need to run under older versions of perl.
last update: D'oh!! why didn't I notice "\$var" the first time?! Still, I'm curious why you would add this in a script that is supposed to run under older versions...
In reply to Re: Compile time problem
by graff
in thread Compile time problem
by syphilis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |