ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl5-porters
perl5-porters
how does 'for my $x (LIST)' alias?
by Jeff Pinyan other posts by this author
Sep 28 2000 6:53PM messages near this date
Re: Memory allocation in 5.6 | [ID 20000928.003] A memory leak of 0.025 bytes per subroutine prototype
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@[...].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/

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved