Re: inner variable access

2003-02-13 Thread John W. Krahn
"R. Joseph Newton" wrote: > > Lance wrote: > > > If I hafta pass in refs from loop1 2 and 3 all the way down the line, So Be > > It. It just makes my argument list a little unsightly, is all. > > You might want to re-examine this view. The process of passing by reference > is not something to

Re: inner variable access

2003-02-13 Thread Wiggins d'Anconia
R. Joseph Newton wrote: Lance wrote: If I hafta pass in refs from loop1 2 and 3 all the way down the line, So Be It. It just makes my argument list a little unsightly, is all. It can also help you prevent confusion. I agree with what you said, particularly about scalability and enca

Re: inner variable access

2003-02-13 Thread R. Joseph Newton
Lance wrote: > If I hafta pass in refs from loop1 2 and 3 all the way down the line, So Be > It. It just makes my argument list a little unsightly, is all. Hi Lance, You might want to re-examine this view. The process of passing by reference is not something to just resign yourself to. It i

Re: inner variable access

2003-02-12 Thread Lance
you're probably right. Danger, Will Robinson! ;-) > Very few things are impossible in Perl. I remember to have seen some > way to access the lexical variables of the calling subroutine. If I > had to I would find it, but ... you don't want to do that. > > If you want other procedures to be able

Re: inner variable access

2003-02-12 Thread Jenda Krynicky
From: "Lance" <[EMAIL PROTECTED]> > Thanks guys! I did not think that it was possible, but some Perl > guru might be able to prove me wrong. Very few things are impossible in Perl. I remember to have seen some way to access the lexical variables of the calling subroutine. If I had to I would f

Re: inner variable access

2003-02-12 Thread Lance
Thanks guys! I did not think that it was possible, but some Perl guru might be able to prove me wrong. I just did not want to pass references into the subs, as a) I have nested loops, with nested subs b) Looking for an easy way to do it. c) growing my meager Perl skillz. So I have:

RE: inner variable access

2003-02-11 Thread Bob Showalter
Bob Showalter wrote: > ... > But foreach loops are funny. Try this: > > use strict; > > our $x = "Hello"; Aargh! That should be "my". To much confusion in my cutting/pasting. > > printx(); > for $x (1..3) { >print "$x\n"; >printx(); > } > printx(); > > sub printx { print "$x\n"; } >

Re: inner variable access

2003-02-11 Thread Jenda Krynicky
To: [EMAIL PROTECTED] From: "Lance" <[EMAIL PROTECTED]> Subject: inner variable access Date sent: Tue, 11 Feb 2003 17:49:25 - > Is there a way to access the 'foreach' variable from a subprocedure

RE: inner variable access

2003-02-11 Thread Bob Showalter
Rob Dixon wrote: > Lance wrote: > > Is there a way to access the 'foreach' variable from a subprocedure > > called from inside the loop whose variable you want to access? > > Hooboy, even I don't understand that question! ;-) An example is > > neccessary, I believe: > > > >foreach my

Re: inner variable access

2003-02-11 Thread Rob Dixon
Lance wrote: > Is there a way to access the 'foreach' variable from a subprocedure > called from inside the loop whose variable you want to access? > Hooboy, even I don't understand that question! ;-) An example is > neccessary, I believe: > >foreach my $store( values %$server ){ >

inner variable access

2003-02-11 Thread Lance
Is there a way to access the 'foreach' variable from a subprocedure called from inside the loop whose variable you want to access? Hooboy, even I don't understand that question! ;-) An example is neccessary, I believe: foreach my $store( values %$server ){ if( $$store{