I must disagree with all of the other responses so far. Why read from the pseudo-filehandle every time, since you need to muck about with seek and tell? Just read everything in once at startup:
my $data; BEGIN { $data = do { local $/; <DATA> }; }
Update: Please heed tye's advice below and use this more as a guide, not as a literal code recommendation. :)
In reply to Re: __DATA__ only one time
by chromatic
in thread __DATA__ only one time
by michaelg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |