Re: local vs. my (was Re: code line of the day)

2006-09-10 Thread A. Pagaltzis
Hi Chris, * Chris Dolan [EMAIL PROTECTED] [2006-09-09 21:00]: I didn't mean that to be insulting -- I was just teasing. […] That was for my curiosity and to convince me, […] I apologize for my less-than-clear motives. no problem, not your fault. I’m a bit impatient sometimes, which can lead

Re: local vs. my (was Re: code line of the day)

2006-09-09 Thread Chris Dolan
On Sep 9, 2006, at 3:12 AM, A. Pagaltzis wrote: * Chris Dolan [EMAIL PROTECTED] [2006-09-09 03:55]: Works the same. I often use `local $_` in tiny functions that mangle just a single value. Matter of taste/style. Ahh, I see -- cargo cult. ;-) Err, what? I chose that style for myself. I

Re: local vs. my (was Re: code line of the day)

2006-09-09 Thread Philippe BooK Bruhat
Le samedi 09 septembre 2006 à 10:12, A. Pagaltzis écrivait: * Uri Guttman [EMAIL PROTECTED] [2006-09-09 05:40]: use local only when you MUST use it. mjd has a good article on the 7 valid uses of local. just declaring vars in a sub is not one of them. If you use $_ in any way within a

local vs. my (was Re: code line of the day)

2006-09-08 Thread Chris Dolan
On Sep 8, 2006, at 6:48 PM, A. Pagaltzis wrote: * Chris Dolan [EMAIL PROTECTED] [2006-09-08 17:10]: Why did you use local? Shouldn't the following work? sub flatten_copy { my $s = shift; ref $s eq 'SCALAR' ? $$s : $s; } Works the same. I often use `local $_` in tiny