http://qs321.pair.com?node_id=70003


in reply to Closing and re-opening the DATA Filehandle

My solution would be to side-step the question with some memoization.
my @Table; { my @_Table; sub LoadTable { unless (@_Table) { local $/; @_Table = map {chomp; hex} split ' ', <DATA>; close DATA; } @Table = @_Table; } }
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.

But still memoization is a good solution to many problems where you wouldn't have thought it applied at first....