Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^4: What's so bad about &function(...)?

by jdporter (Paladin)
on Dec 07, 2005 at 22:50 UTC ( [id://515065]=note: print w/replies, xml ) Need Help??


in reply to Re^3: What's so bad about &function(...)?
in thread What's so bad about &function(...)?

@{[@foo]} is really wrong, for the obvious reason that it copies the contents of @foo into a new (anonymous) array, so that, for example, splice( @{[@foo]}, 0, 5 ) does not modify @foo.

But why is @{\@foo} wrong? Whatever the answer is, the same could be said of &foo() (aside from the extremely tiny overhead of taking and dereffing a ref).

We're building the house of the future together.

Replies are listed 'Best First'.
Re^5: What's so bad about &function(...)?
by Anonymous Monk on Dec 08, 2005 at 16:48 UTC
    But why is @{\@foo} wrong? Whatever the answer is, the same could be said of &foo() (aside from the extremely tiny overhead of taking and dereffing a ref). It's only wrong in the sense that:

     $great_answer=(((1+1)**(1+1+1))-1)*(1+1+1)*(1+1);

    is "wrong"; it's too complicated, and "should" read:
     $great_answer=42;

    (Alternatively, it's overly complicated for some good reason which was left undocumented, which is IMHO more wrong. :-) )

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (8)
As of 2024-03-28 11:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found