Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Unifying namespaces of @name and $name to simplify dereferencing?

by RonW (Parson)
on Mar 30, 2016 at 00:47 UTC ( #1159063=note: print w/replies, xml ) Need Help??


in reply to Unifying namespaces of @name and $name to simplify dereferencing?

Have you looked at Perl6::Variables ? It appears to provide the implicit dereferencing you want - at least when accessing elements of an array/hash. (Along with other Perl6 variable related syntax.)

By itself, it does not enforce single type use of symbol names, but that could be done with another module.

Update: Looking at it more, it doesn't attempt to translate @array to \@array so passing an array ref or assigning to a scalar still requires using \@array - but, once passed or assigned, $second = $aref[1] will work.

However, even with a means to enforce single type use of symbol names, I still question whether implicit dereferencing in Perl5 would always be safe.

Note: Perl6 has explicit dereferencing as well, using . instead of ->

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2019-11-13 07:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (70 votes). Check out past polls.

    Notices?