Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Storing variable coordinates in a matrix

by Fletch (Bishop)
on Mar 15, 2007 at 16:37 UTC ( [id://605016]=note: print w/replies, xml ) Need Help??


in reply to Storing variable coordinates in a matrix

Aside from a few extra parens, your problem is that you're storing the value in $x and $y as it is at the time @A is initialized. In order to get close to doing what you want you'd need to store references to $x and $y, but that won't let you store (say) $y+1 and you'd have an additional layer of dereferencing to get the values out.

The best compromise would be to make a sub which returns a new set of coords given a new $x and $y.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-24 08:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found