Static variables have their uses. For example, one might generate a crc32 table on-demand. This has the advantages of: (1) not using globals, (2) not relying on BEGIN, (3) on-demand construction, (4) conciseness. It replaces the less expressive construct
There's nothing wrong with procedural programming.{ my $table; sub foo { $table //= init_tables(0x123); ... } }
In reply to Re^3: Variable scope
by Anonymous Monk
in thread Variable scope
by Alphaphi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |