in reply to Re: can you assign file handles?
in thread can you assign file handles?

Whoa... Actually, you would need

if ("true" eq $flag) {

or

if ($flag) {

as the condtion of the if statement (I'm still not sure if they wanted to actually test for boolean truth or equality to the string "true"). Assignment's right out.

But the reopening of OUT is definately what they wanted! =) (Though I think I, personally, actually prefer Fastolfe's method of using the trinary operator and one open statement so as not to duplicate code and so you test the dup-open for success as well. TIMTOWTDI. =)

bbfu