develooper Front page | perl.perl5.porters | Postings from September 2000

how does 'for my $x (LIST)' alias?

From:
Jeff Pinyan
Date:
September 28, 2000 15:53
Subject:
how does 'for my $x (LIST)' alias?
Message ID:
Pine.GSO.4.21.0009281833340.5957-100000@crusoe.crusoe.net
I was looking at the B::Terse output for these two pieces of code:

  for $X (1) { }

and

  for my $Y (1) { }

I know that $X is aliased to 1 (via *X = \1), but I don't understand the
mechanism through which the padlist $Y is aliased to 1.  I was grepping
the .h and .c files for 'foreach', and then looked for 'enteriter'.

I'm just not sure where to look.  I'd like pointers to code, or else an
explanation.  Is it more or less saying that the address of the SV on the
pad is the address of the SV in the stack?

-- 
Jeff "japhy" Pinyan     japhy@pobox.com     http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine            http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc.    http://www.perlarchive.com/
CPAN - #1 Perl Resource  (my id:  PINYAN)        http://search.cpan.org/




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About