Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^3: Can @_ be extended?

by tphyahoo (Vicar)
on Feb 11, 2005 at 13:23 UTC ( [id://430080]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Can @_ be extended?
in thread Can @_ be extended?

This won't work in perl 6, though, will it?

In answer to my recent post Trying to understand aliasing (*var), dave_the_m wrote

"Typeglobs, ie *foo are mostly an artifact of Perl 4, which didn't have references; they will be removed completely in Perl6"

So that might be a reason to avoid this particular type of magic, and stick with a slash type \$reference.

Replies are listed 'Best First'.
Re^4: Can @_ be extended?
by Ven'Tatsu (Deacon) on Feb 11, 2005 at 15:51 UTC

    Typeglobs will go away in Perl6, but they will be replaced by a more consistent := aliasing operator. In Perl5 you would write *foo = \@bar in Perl6 you would write @foo := @bar.

    Though if I read Apocalypse 6 correctly then

    sub foo (@foo is rw) { ... } foo(@bar);
    Will alias @bar to @foo, in the same way as @foo := @bar does, for that call.

    I don't see a reason to avoid typeglobs if you must alias something in Perl5. Ponie (Perl5 running on Parrot) will certainly support typeglobs, and I don't a good reason to compleatly throw away a useful (but seldom to be used) technique just because the next major version of Perl will not use that syntax for aliases. Should I stop using objects in Perl5 because Perl6 has a totally different object syntax?

      Don't get me wrong - I completely agree that you can't throw something away just because it won't be in perl 6 (since pretty much the whole perl5 language would be thrown away). However, I think that tphyahoo's comment was more based on the "seldom used" part of your comment: there are some "more advanced" areas of perl 5 which, if you aren't already comfortable with them, may not be worth the effort to learn at this point. I'm not sure that typeglobs are in that category, but, as a generality, I think the logic makes sense. Where that line is drawn may be different for each person, but that the line exists for some people I think is a reasonable statement.

      Personally, I'm a complete geek, and won't stop abusing the crap out of perl 5 until perl 6 is somewhat established. But I can understand how that may not be true (or even should not be true) for some people.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2024-04-25 08:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found