in reply to __DATA__ only one time
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. :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: __DATA__ only one time (close !BEGIN)
by tye (Sage) on Nov 24, 2003 at 19:35 UTC | |
|
Re: Re: __DATA__ only one time
by allolex (Curate) on Nov 24, 2003 at 18:08 UTC |