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!

Reply via email to