in reply to Closing and re-opening the DATA Filehandle
Issues with this? Well first of all you are assuming that DATA doesn't have too much in it, and you assume that it has something.my @Table; { my @_Table; sub LoadTable { unless (@_Table) { local $/; @_Table = map {chomp; hex} split ' ', <DATA>; close DATA; } @Table = @_Table; } }
But still memoization is a good solution to many problems where you wouldn't have thought it applied at first....
|
|---|