Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: question on declaring variables

by toolic (Bishop)
on Nov 22, 2018 at 12:03 UTC ( #1226177=note: print w/replies, xml ) Need Help??

in reply to question on declaring variables

Yes, the declaration is the same for both files, but $a is a special variable, whereas $x and $y are not. You get the error messages because you correctly use strict:
Because of their special use by sort(), the variables $a and $b are exempted from this check.
You should avoid using $a and $b because they are special for the sort function. As the helpful message reports, you need to declare x and y with my.

Replies are listed 'Best First'.
Re^2: question on declaring variables
by badbanana (Novice) on Nov 22, 2018 at 12:15 UTC
    oh i see. thanks, got it!

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2022-01-22 00:44 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (60 votes). Check out past polls.