in reply to Conditional creation of files - global or scoped filehandle

What I always do is roughly the following although you can switch this to global instead of object if you are physically compelled ;)
my $obj = MyPackage::new(); # sets $obj->{FH}='' if ('some condition') { 'do something about that'; if ('another nested block') { open my $lh, 'etc.'; $obj->getset('FH', $lh); # or maybe $obj->{FH}=$lh; } }
but if objects are illegal in your organisation: my $fh = '' at global scope level and update it with $lh where applicable.

One world, one people