if ("true" eq $flag) { open (OUT, ">output.txt") or die ("could not open output.txt: $!") +; } else { open (OUT, ">&STDOUT"); }
Update:Changed as per bbfu's comment below, although I kept the duplication because IMHO it makes it easier for a newbie to follow.
*~-}hotyopa{-~*
In reply to Re: can you assign file handles?
by hotyopa
in thread can you assign file handles?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |