Re: Source/Program metadata from within a program

2001-09-03 Thread Michael G Schwern
On Mon, Sep 03, 2001 at 04:56:28PM +0100, Nick Ing-Simmons wrote: The problem is, it appears DATA is only opened if there's an __END__ or __DATA__ tag. I don't remember it working this way... *shrug* We can fix that easy. :) No you can't - you run out of fd's pretty quick if every .pm

Re: Source/Program metadata from within a program

2001-08-31 Thread John Porter
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. -- John Porter

Re: Source/Program metadata from within a program

2001-08-31 Thread John Porter
Access to the source code. Particularly comments and POD. Cool--I'd suggest a special $*CODE filehandle, to match $*DATA First, take a look at RFC 79, which I think addresses the wants here. My thoughts on how it should work are a little different now, but I guess it's too late to

RE: Source/Program metadata from within a program

2001-08-31 Thread Garrett Goebel
From: Nicholas Clark [mailto:[EMAIL PROTECTED]] On Thu, Aug 30, 2001, Brent Dax wrote: From: Michael G Schwern [mailto:[EMAIL PROTECTED]] # On Fri, Aug 31, 2001, Bryan C. Warnock wrote: # Access to the source code. # # Already got that. # # use Fcntl qw(:seek); # seek

Re: Source/Program metadata from within a program

2001-08-31 Thread Michael G Schwern
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

Re: Source/Program metadata from within a program

2001-08-31 Thread Michael G Schwern
On Fri, Aug 31, 2001 at 11:25:17AM +0100, Nicholas Clark wrote: Who said that my source file handle was seekable? The problem is, it appears DATA is only opened if there's an __END__ or __DATA__ tag. I don't remember it working this way... *shrug* We can fix that easy. :) -- Michael G.

Re: Source/Program metadata from within a program

2001-08-30 Thread Dave Storrs
On Fri, 31 Aug 2001, Bryan C. Warnock wrote: Access to the source code. Particularly comments and POD. I'd also like to be able to access information on the particular perl that is running this program...e.g., does it support 64-bit nums, what is the endianness of the native

RE: Source/Program metadata from within a program

2001-08-30 Thread Brent Dax
# -Original Message- # From: Dave Storrs [mailto:[EMAIL PROTECTED]] # Sent: Thursday, August 30, 2001 9:59 PM # To: The Perl6 Language List # Subject: Re: Source/Program metadata from within a program # # On Fri, 31 Aug 2001, Bryan C. Warnock wrote: # # Access to the source code

Re: Source/Program metadata from within a program

2001-08-30 Thread Michael G Schwern
On Fri, Aug 31, 2001 at 12:45:03AM -0400, Bryan C. Warnock wrote: Access to the source code. Already got that. use Fcntl qw(:seek); seek DATA, 0, SEEK_SET; @code = DATA; We're going to be carrying it around, unless we strip it. We might as well put it to good use within

Re: Source/Program metadata from within a program

2001-08-30 Thread Bryan C . Warnock
On Friday 31 August 2001 01:13 am, Michael G Schwern wrote: On Fri, Aug 31, 2001 at 12:45:03AM -0400, Bryan C. Warnock wrote: Access to the source code. Already got that. Not if we don't have the source. Or perhaps this will be the way we do it. Dunno. Perl Bytecode has a section for

Re: Source/Program metadata from within a program

2001-08-30 Thread Bryan C . Warnock
On Friday 31 August 2001 01:13 am, Brent Dax wrote: # -Original Message- # From: Dave Storrs [mailto:[EMAIL PROTECTED]] # I'd also like to be able to access information on the # particular perl that # is running this program...e.g., does it support 64-bit nums, # what is the #

Re: Source/Program metadata from within a program

2001-08-30 Thread Bryan C . Warnock
On Friday 31 August 2001 01:13 am, Brent Dax wrote: Cool--I'd suggest a special $*CODE filehandle, to match $*DATA (that isn't going away, is it?). IIRC, $*DATA is going away, in favor of something a little more Inline::File-ish - i.e., an arbitrary number of arbitrarily named pseudohandles.

RE: Source/Program metadata from within a program

2001-08-30 Thread Brent Dax
# -Original Message- # From: Michael G Schwern [mailto:[EMAIL PROTECTED]] # Sent: Thursday, August 30, 2001 10:13 PM # To: Bryan C. Warnock # Cc: [EMAIL PROTECTED] # Subject: Re: Source/Program metadata from within a program # # # On Fri, Aug 31, 2001 at 12:45:03AM -0400, Bryan C. Warnock

Re: Source/Program metadata from within a program

2001-08-30 Thread Michael G Schwern
On Thu, Aug 30, 2001 at 10:52:27PM -0700, Brent Dax wrote: # Already got that. # # 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. An explicit $*CODE filehandle would make more