Re: puzzling greed

2002-06-14 Thread Peter Scott
At 04:03 PM 6/14/02 -0700, Yitzchak Scott-Thoennes wrote: >In article <[EMAIL PROTECTED]>, >Peter Scott <[EMAIL PROTECTED]> wrote: > >..+? Match at least one character that isn't a newline, > >I assume you meant '.+?'. Yes, that is in fact what I typed. >Avoid putting periods at the

Re: perl5.6.1 oddity?

2002-06-14 Thread Bart Lateur
On Fri, 14 Jun 2002 16:33:57 -0500, Chris Dolan wrote: >Sorry for the newbie-ish question, but can someone explain why = >does not warn? Is it because (quoting perlop) > > $a += 2; is equivalent to $a = $a + 2; although without > duplicating any side effects that dereferencing the lvalue

Re: puzzling greed

2002-06-14 Thread Yitzchak Scott-Thoennes
In article <[EMAIL PROTECTED]>, Peter Scott <[EMAIL PROTECTED]> wrote: >..+? Match at least one character that isn't a newline, I assume you meant '.+?'. Avoid putting periods at the beginning of a line since many mail agents do s/^\./../m.

Re: perl5.6.1 oddity?

2002-06-14 Thread Yitzchak Scott-Thoennes
In article <[EMAIL PROTECTED]>, Chris Dolan <[EMAIL PROTECTED]> wrote: >can someone explain why = >does not warn? Is it because (quoting perlop) > > $a += 2; is equivalent to $a = $a + 2; although without > duplicating any side effects that dereferencing the lvalue > might trigger > >

Re: perl5.6.1 oddity?

2002-06-14 Thread Michael G Schwern
On Fri, Jun 14, 2002 at 08:34:03PM +0200, Bart Lateur wrote: > What's so special about concatenation, anyway? Welp, here's the change that fixed the 5.6 concat/warning bugs: http://public.activestate.com/cgi-bin/perlbrowse?patch=10223&action=patch and here's the thread on p5p about it. http://ww

Re: perl5.6.1 oddity?

2002-06-14 Thread Chris Dolan
Sorry for the newbie-ish question, but can someone explain why = does not warn? Is it because (quoting perlop) $a += 2; is equivalent to $a = $a + 2; although without duplicating any side effects that dereferencing the lvalue might trigger and the warn is considered a side effect

Re: perl5.6.1 oddity?

2002-06-14 Thread Michael G Schwern
On Fri, Jun 14, 2002 at 11:48:33AM +0200, Bart Lateur wrote: > Perhaps... (I feel like disagreeing, though.) > > Anyway: > > my($foo, $bar); $foo = $bar . 42; > > *should* warn. It does in 5.8.0. -- This sig file temporarily out of order.

Re: perl5.6.1 oddity?

2002-06-14 Thread Bart Lateur
On Fri, 14 Jun 2002 11:27:33 -0400 (EDT), Jeff 'japhy' Pinyan wrote: >>On Fri, 14 Jun 2002 00:21:16 -0400, Michael G Schwern wrote: >> >>>The history is someone noticed that since this: >>> >>> my $foo; $foo = $foo . 42 >>> Use of uninitialized value at -e line 1. >>> >>>and this: >>>

Re: perl5.6.1 oddity?

2002-06-14 Thread Jeff 'japhy' Pinyan
On Jun 14, Bart Lateur said: >On Fri, 14 Jun 2002 00:21:16 -0400, Michael G Schwern wrote: > >>The history is someone noticed that since this: >> >> my $foo; $foo = $foo . 42 >> Use of uninitialized value at -e line 1. >> >>and this: >> >> my $foo; $foo .= 42 >> >>are logically t

Re: puzzling greed

2002-06-14 Thread Bart Lateur
On Thu, 13 Jun 2002 21:36:25 -0700, Paul Makepeace wrote: >Can someone explain the first result? > >$ perl -wle '$_ = "small - medium - large"; >/- (.+?)$/; print $1; >medium - large >I was expecting just "large" with the non-greedy match. Basic rule: non-greediness only affects the righ

Re: perl5.6.1 oddity?

2002-06-14 Thread Bart Lateur
On Fri, 14 Jun 2002 00:21:16 -0400, Michael G Schwern wrote: >The history is someone noticed that since this: > > my $foo; $foo = $foo . 42 > Use of uninitialized value at -e line 1. > >and this: > > my $foo; $foo .= 42 > >are logically the same, the former shouldn't warn. Perh