in reply to Conditional creation of files - global or scoped filehandle
but if objects are illegal in your organisation: my $fh = '' at global scope level and update it with $lh where applicable.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; } }
One world, one people
|
|---|