Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: (jeffa) 3Re: Arrays

by dsheroh (Monsignor)
on May 06, 2002 at 21:56 UTC ( [id://164464]=note: print w/replies, xml ) Need Help??


in reply to (jeffa) 3Re: Arrays
in thread How do I reset an array?

I get (no pun intended) how the original get_array works. What I'm unclear on is why you called it with &get_array() instead of just get_array(). I'm used to seeing \& used when setting up references to subs, but this is the first time I've encountered &subname() without the backslash.

Replies are listed 'Best First'.
(jeffa) 5Re: Arrays
by jeffa (Bishop) on May 06, 2002 at 22:21 UTC
    Oh! /smack forehead :P

    I only did that because that's how Jaspersan called the function. Personally, i hate prefixing function calls with the ampersand unless i am taking a reference to them, as you can probably tell from the rest of the code i posted.

    However, tye has chastised me for this, and i understand why - because it distinguishes your functions from Perl's internal functions. Parens are not enough:

    print "Hello World!\n"; print("Hello World!\n"); &print("Hello World?\n"); sub print { print "yo!\n"; }

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-04-23 19:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found