Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: Array storage issue

by Anonymous Monk
on Apr 06, 2014 at 22:23 UTC ( #1081349=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Array storage issue
in thread Array storage issue

My issue isn't strict, I don't know why everyone says that.

Because you write $main::c and other $main:: stuff

You wrote $main::hd to stop strict from complaining but that is a package/global variable

The solution was use lexical variables  my $hd = ...;

Also you should avoid one letter variables, especially $a and $b, they're special

If you're interested :) Tutorials: Variable Scoping in Perl: the basics,
Coping with Scoping , Mini-Tutorial: Perl's Memory Management,
Lexical scoping like a fox,


Comment on Re^4: Array storage issue
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2015-07-03 08:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (49 votes), past polls