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

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

Jeff Pinyan
September 28, 2000 15:53
how does 'for my $x (LIST)' alias?
Message ID:
I was looking at the B::Terse output for these two pieces of code:

  for $X (1) { }


  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
PerlMonth - An Online Perl Magazine  
The Perl Archive - Articles, Forums, etc.
CPAN - #1 Perl Resource  (my id:  PINYAN) Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About