Re: Dynamical our/my/local

2006-10-31 Thread Oleg V. Volkov
"Oleg V. Volkov" <[EMAIL PROTECTED]> wrote: [skip] > but declaring > parameters two times - first as "our" variables and then once again > as a list for this function to check against, so it can catch > errors in list looks kinda ineffective to me. Seems like I've found something that will help me

Re: Dynamical our/my/local

2006-10-30 Thread Oleg V. Volkov
"Oleg V. Volkov" <[EMAIL PROTECTED]> wrote: [skip] > Speaking of globals, AFAIK, I have virtually no drawbacks > against "my", as long as I use "our" variables inside > the scope. So what's bad there in using "our"? After some thinking I've found a scenario where Alias::attr use of globals can giv

Re: Dynamical our/my/local

2006-10-24 Thread Oleg V. Volkov
"Dr.Ruud" <[EMAIL PROTECTED]> wrote: >> Alias::attr (and, as far as I understand all other >> modules that perform namespace/glob tricks) operate >> exclusively on globals. > Did you check Data::Alias too? Really nice, but, alas, no Win32 and that's where I run most of my stuff. It also wouldn be

Re: Dynamical our/my/local

2006-10-24 Thread Dr.Ruud
"Oleg V. Volkov" schreef: > Alias::attr (and, as far as I understand all other > modules that perform namespace/glob tricks) operate > exclusively on globals. Did you check Data::Alias too? >From the examples: alias my $fi = $self->{FrobnitzIndex}; This works a bit like for my $fi ($sel

Re: Dynamical our/my/local

2006-10-24 Thread Oleg V. Volkov
"Jenda Krynicky" <[EMAIL PROTECTED]> wrote: >> > Provide code, so we can guess better. >> Here's example how I use it in functions: >> sub add_service{ >> our($login, $type_id, $account_id, $ap_id, $rule); > Please DON'T! > You DO want to use >my ($login, $type_id, $account_id, $ap_id, $ru

Re: Dynamical our/my/local

2006-10-23 Thread Jenda Krynicky
From: "Oleg V. Volkov" <[EMAIL PROTECTED]> > "Dr.Ruud" <[EMAIL PROTECTED]> wrote: > > Provide code, so we can guess better. > > Here's example how I use it in functions: > > sub add_service{ > our($login, $type_id, $account_id, $ap_id, $rule); Please DON'T! You DO want to use my ($log

Re: Dynamical our/my/local

2006-10-23 Thread Oleg V. Volkov
"Dr.Ruud" <[EMAIL PROTECTED]> wrote: > Provide code, so we can guess better. Here's example how I use it in functions: sub add_service{ our($login, $type_id, $account_id, $ap_id, $rule); # Here we do some universal sanity checks for all add_* functions attr({ croak_wrong_args(@_) }); print "A

Re: Dynamical our/my/local

2006-10-20 Thread Randal L. Schwartz
> ""Oleg" == "Oleg V Volkov" <[EMAIL PROTECTED]> writes: "Oleg> I'm using a simple Getopt::* / Alias::attr like function to parse "Oleg> named parameters from hash and assign them to localized variables "Oleg> to save me some dereferencing inside heavy loops, but declaring "Oleg> parameters tw

Re: Dynamical our/my/local

2006-10-20 Thread Dr.Ruud
"Oleg V. Volkov" schreef: > Is there a way to do something to effect of: > our ${$varname}; > > I'm using a simple Getopt::* / Alias::attr like function to parse > named parameters from hash and assign them to localized variables > to save me some dereferencing inside heavy loops, but declaring >

Re: Dynamical our/my/local

2006-10-20 Thread Oleg V. Volkov
"Jenda Krynicky" <[EMAIL PROTECTED]> wrote: >> Is there a way to do something to effect of: >> our ${$varname}; [skip] > Have a look at >use vars qw($list @of %variables); [skip] > I don't think you can emulate 'local' or 'my'. You should also be aware of > the different scoping of the 'o

Re: Dynamical our/my/local

2006-10-20 Thread Jenda Krynicky
From: "Oleg V. Volkov" <[EMAIL PROTECTED]> > Greetings. > > Is there a way to do something to effect of: > our ${$varname}; > > I'm using a simple Getopt::* / Alias::attr like function to parse > named parameters from hash and assign them to localized variables to > save me some dereferencing ins