Re: regex matching from a position ?

2003-02-12 Thread Ph. Marek
Phil, please see the perlfunc entry for pos and the perlre section on \G. This is what you need. Thanks a lot! I know about pos but thought it was read-only. And \G is relatively new, isn't it? Certainly wasn't existing in '97 when I learned perl :-) And the basics are seldom read again in

Re: File operators don't dwim

2003-02-12 Thread Stéphane Payrard
On Wed, Feb 12, 2003 at 09:17:22AM +0100, Stéphane Payrard wrote: On Tue, Feb 11, 2003 at 11:42:27PM -0800, Brent Dax wrote: Stéphane Payrard: # I was so sure that, in case of success, the file operators # would return the filename that I wrote the following code to # print where are

Re: File operators don't dwim

2003-02-12 Thread Stéphane Payrard
On Tue, Feb 11, 2003 at 11:42:27PM -0800, Brent Dax wrote: Stéphane Payrard: # I was so sure that, in case of success, the file operators # would return the filename that I wrote the following code to # print where are the perl interpretors in the PATH. But, in # case of success, fileops

Re: Arrays vs. Lists

2003-02-12 Thread Mark J. Reed
On 2003-02-11 at 16:52:36, Dave Whipp wrote: Mark J. Reed [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On 2003-02-11 at 17:44:08, Mark J. Reed wrote: pop @{[@a,@b,@c]} It creates an anonymous array, then removes the last element,

Re: Arrays vs. Lists

2003-02-12 Thread Joseph F. Ryan
Mark J. Reed wrote: On 2003-02-11 at 17:12:52, Joseph F. Ryan wrote: (@a,@b,@c).pop This doesn't make any sense, since pop modifies the pop-ee. What do you expect should happen here? [@a,@b,@c].pop Same as above. Except that the Perl5 equivalent, ugly as the

Re: Arrays vs. Lists

2003-02-12 Thread Mark J. Reed
On 2003-02-12 at 11:07:45, Joseph F. Ryan wrote: Meaning that I think this should be possible, but I'm not sure if that syntax is correct, because it would mean that the arrayrefs would need to be their own class to allow a method to be called on it. No, they wouldn't, unless I'm missing

Re: Arrays, lists, referencing (was Re: Arrays vs. Lists)

2003-02-12 Thread Michael Lazzaro
On Tuesday, February 11, 2003, at 04:56 PM, Deborah Ariel Pickett wrote: But is it OK for a list to be silently promoted to an array when used as an array? So that all of the following would work, and not just 50% of them? (1..10).map {...} [1..10].map {...} And somehow related to

Re: Arrays vs. Lists

2003-02-12 Thread Erik Steven Harrison
-- On Tue, 11 Feb 2003 12:28:23 Luke Palmer wrote: Date: Tue, 11 Feb 2003 10:34:57 -0800 From: Michael Lazzaro [EMAIL PROTECTED] On Monday, February 10, 2003, at 05:56 PM, Luke Palmer wrote: Indeed, this supports the distinction, which I will reiterate: - Arrays are

Arrays vs lists; A possible solution?

2003-02-12 Thread Joseph F. Ryan
As near as I can tell, the only problem with the nice flow of: A Iliteral is a piece of data. A Iscalar is a variable that holds a literal. A Ilist is a sequence of literals and scalars. An Iarray is a variable that holds a list. is the Rvalue-assign list, which takes the form of: ($r1, $r2,

Re: Arrays vs lists; A possible solution?

2003-02-12 Thread Erik Steven Harrison
-- On Wed, 12 Feb 2003 18:29:29 Joseph F. Ryan wrote: As near as I can tell, the only problem with the nice flow of: A Iliteral is a piece of data. A Iscalar is a variable that holds a literal. A Ilist is a sequence of literals and scalars. An Iarray is a variable that holds a list.

Re: Arrays vs lists; A possible solution?

2003-02-12 Thread Erik Steven Harrison
-- On Wed, 12 Feb 2003 17:14:17 Erik Steven Harrison wrote: -- On Wed, 12 Feb 2003 18:29:29 Joseph F. Ryan wrote: As near as I can tell, the only problem with the nice flow of: A Iliteral is a piece of data. A Iscalar is a variable that holds a literal. A Ilist is a sequence of

Re: Arrays, lists, referencing (was Re: Arrays vs. Lists)

2003-02-12 Thread Deborah Ariel Pickett
Here are some of the answers from my own notes. These behaviors have all been confirmed on-list by the design team: An @array in list context returns a list of its elements An @array in scalar context returns a reference to itself (NOTE1) An @array in numeric (scalar) context returns