Re: List assignment question

2006-11-16 Thread Jonathan Rockway
Mark J. Reed wrote: I distinctly recall having to do things like (my $a, undef, my $b) to avoid errors because you can't assign to undef. Maybe I'm just hallucinating. Maybe :) $ perl -Mstrict -e 'my ($a, undef, $b) = 1..3; print $a $b\n;' 1 3 This works as far back as v5.6.0 (which is the

Re: List assignment question

2006-11-16 Thread Jonathan Rockway
Vincent Foley wrote: Hello everyone, I was toying around with Pugs and I tried the following Perl 5 list assignment my ($a, undef, $b) = 1..3; Which gave me the following error message: Internal error while running expression: *** Unexpected , expecting word

Re: List assignment question

2006-11-16 Thread Larry Wall
On Wed, Nov 15, 2006 at 10:28:41AM -0600, Jonathan Rockway wrote: : For reference, this sort of operation works if you write it on two : lines, like: : : my ($a, $b); : ($a, undef, $b) = 1..3; : say $a is 1 and $b is 3; : : I'll look around in the source and see if I can make this

Re: List assignment question

2006-11-15 Thread Larry Wall
On Tue, Nov 14, 2006 at 10:15:42PM -0500, Vincent Foley wrote: : Hello everyone, : : I was toying around with Pugs and I tried the following Perl 5 list : assignment : : my ($a, undef, $b) = 1..3; : : Which gave me the following error message: : : Internal error while running expression: :

Re: List assignment question

2006-11-15 Thread Mark J. Reed
On 11/14/06, Vincent Foley [EMAIL PROTECTED] wrote: I was toying around with Pugs and I tried the following Perl 5 list assignment my ($a, undef, $b) = 1..3; Huh. I didn't think that worked in Perl 5, either. What am I misremembering? I distinctly recall having to do things like (my $a,

Re: List assignment question

2006-11-15 Thread Ævar Arnfjörð Bjarmason
On 11/15/06, Mark J. Reed [EMAIL PROTECTED] wrote: On 11/14/06, Vincent Foley [EMAIL PROTECTED] wrote: I was toying around with Pugs and I tried the following Perl 5 list assignment my ($a, undef, $b) = 1..3; Huh. I didn't think that worked in Perl 5, either. What am I misremembering? I

Re: List assignment question

2006-11-15 Thread Brandon S. Allbery KF8NH
On Nov 15, 2006, at 12:04 PM, Mark J. Reed wrote: On 11/14/06, Vincent Foley [EMAIL PROTECTED] wrote: I was toying around with Pugs and I tried the following Perl 5 list assignment my ($a, undef, $b) = 1..3; Huh. I didn't think that worked in Perl 5, either. What am I

Re: List assignment question

2006-11-15 Thread Paul Seamons
my ($a, undef, $b) = 1..3; Huh. I didn't think that worked in Perl 5, either. What am I misremembering? I distinctly recall having to do things like (my $a, undef, my $b) to avoid errors because you can't assign to undef. Maybe I'm just hallucinating. Are you remembering this: my

Re: List assignment question

2006-11-15 Thread Nicholas Clark
On Wed, Nov 15, 2006 at 05:41:24PM +, Ævar Arnfjörð Bjarmason wrote: On 11/15/06, Mark J. Reed [EMAIL PROTECTED] wrote: On 11/14/06, Vincent Foley [EMAIL PROTECTED] wrote: I was toying around with Pugs and I tried the following Perl 5 list assignment my ($a, undef, $b) = 1..3;

Re: List assignment question

2006-11-15 Thread Dave Mitchell
On Wed, Nov 15, 2006 at 11:17:57PM +, Nicholas Clark wrote: I thought that allowing undef in my ($a, undef, $b) came in around 5.004ish, but I can't find it in perldelta, and I don't have a version compiled to test with (or any quick way to compile them, given that pretty much only AIX is

Re: List assignment question

2006-11-15 Thread Mark J. Reed
On 11/15/06, Ævar Arnfjörð Bjarmason [EMAIL PROTECTED] wrote: On 11/15/06, Mark J. Reed [EMAIL PROTECTED] wrote: On 11/14/06, Vincent Foley [EMAIL PROTECTED] wrote: I was toying around with Pugs and I tried the following Perl 5 list assignment my ($a, undef, $b) = 1..3; Huh. I didn't

Re: List assignment question

2006-11-15 Thread Mark J. Reed
On 11/15/06, Dave Mitchell [EMAIL PROTECTED] wrote: $ perl-5322 -we'my ($x,undef,$y) = 1..3' Can't declare undef operator in my at -e line 1, near ) = Execution of -e aborted due to compilation errors. $ perl545 -we'my ($x,undef,$y) = 1..3' $ Ah-hah! So I'm not crazy! Necessarily, anyway.