Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: why need my in a foreach loop?

by JavaFan (Canon)
on Nov 28, 2010 at 12:08 UTC ( #874095=note: print w/replies, xml ) Need Help??


in reply to why need my in a foreach loop?

In the old days of perl5,
foreach my $var (LIST) { .. }
was a syntax error. You had to write:
my $var; foreach $var (LIST) { .. }
or use a package variable, as pointed out earlier in this thread.

I remember the days that

foreach my $var (LIST) { .. }
was actually seen as progress...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://874095]
help
Chatterbox?
[Lady_Aleena]: Ratazong, you didn't know about Cookies?
[Lady_Aleena]: shmem, jedikaiti would appreciate that. 8)
[shmem]: no doubt, Lady_Aleena - maybe others, too. A whole barrel just for cookies would be too much for one person alone.

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2017-04-26 10:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (471 votes). Check out past polls.