On Fri, Aug 31, 2001 at 10:04:00AM -0400, John Porter wrote: > Brent Dax wrote: > > > use Fcntl qw(:seek); > > > seek DATA, 0, SEEK_SET; > > > @code = <DATA>; > > > > IMHO, that's too hackish--just reading that doesn't make what you're > > doing obvious. > > It also can only get the main program, not any of the modules it loads. use Some::Module; use Fcntl qw(:seek); seek Some::Module::DATA, 0, SEEK_SET; @their_code = <Some::Module::DATA>; which only works if Some::Module has an __END__ block... but that shouldn't be hard to fix. -- Michael G. Schwern <[EMAIL PROTECTED]> http://www.pobox.com/~schwern/ Perl6 Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One Lord of Kwalitee! Wearer of the CPANTS and Slayer of Pseudo-hashes!
- Re: Source/Program metadata from within a program Bryan C . Warnock
- Re: Source/Program metadata from within a program Bryan C . Warnock
- Re: Source/Program metadata from within a program John Porter
- Re: Source/Program metadata from within a program Michael G Schwern
- Re: Source/Program metadata from within a program Bryan C . Warnock
- RE: Source/Program metadata from within a program Brent Dax
- Re: Source/Program metadata from within a program Michael G Schwern
- Re: Source/Program metadata from within a program Michael G Schwern
- Re: Source/Program metadata from within a progr... Michael G Schwern
- Re: Source/Program metadata from within a program John Porter
- RE: Source/Program metadata from within a program Michael G Schwern
- RE: Source/Program metadata from within a program Garrett Goebel