in reply to Re^4: variable scopes in Excel::Writer::XLSX
in thread variable scopes in Excel::Writer::XLSX
I misused the word 'closure' in my original post. I wanted to assign the workbook to a static variable. I believe that the structure I used is a commonly idiom in Perl for making a variable static.
Yes that is old idiom, and yes, it is called a closure (Closure on Closures) because func closes over $closure_workbook, a lexical variable declared in outer scope.
The new idiom is state / use feature qw' state ';
OTOH, its not really static without this unless( $closure_workbook ) { if( @_ ) ... }
|
|---|