Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: [Homework Question] Subroutines & References

by AnomalousMonk (Archbishop)
on Feb 12, 2015 at 17:52 UTC ( [id://1116530]=note: print w/replies, xml ) Need Help??


in reply to Re: [Homework Question] Subroutines & References
in thread [Homework Question] Subroutines & References

foreach $i (@array) { ... }

Posted code won't run under strictures due to non-declaration of  $i iterator. Making  $i lexical fixes this:
    foreach my $i (@array) { ... }
(Running with  use strict; and  use warnings; is highly recommended for beginning Perl programmers — and for non-beginners as well!)


Give a man a fish:  <%-(-(-(-<

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1116530]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-04-18 15:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found