Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: why use a coderef?

by exussum0 (Vicar)
on Jun 25, 2007 at 13:29 UTC ( #623169=note: print w/ replies, xml ) Need Help??


in reply to why use a coderef?

Technically, you don't /have/ to. It's a construct of convenience for someone. All one ever really needs to code is a way of doing addition and subtraction, jumping to a particular place in code and some hardware interface.

The code ref allows you to pass around what you'd want to jump to, not all that different from array indexes if you step back a little. Code refs are just values passed around to say what should be executed next. Array indexes are just values that can be recalled to know which value you meant, later.

If they seem nasty, you could always pass around labels you can goto, to. :)


Comment on Re: why use a coderef?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2014-09-18 23:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (128 votes), past polls