Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re^3: Unifying namespaces of @name and $name... (bare lexicals)

by oiskuu (Hermit)
on Mar 28, 2016 at 09:13 UTC ( #1158935=note: print w/replies, xml ) Need Help??

in reply to Re^2: Unifying namespaces of @name and $name... (bare lexicals)
in thread Unifying namespaces of @name and $name to simplify dereferencing?

Well, I did not mean to suggest we do away with sigils altogether. These are just too convenient, if only for string interpolation.

To illustrate the possibilities: let's say we have the statement

my foo = [ 1, 2, 3 ];
This shadows all other symbols foo in scope. Further, any $ @ % sigils on foo are just shorthand for ${} @{} %{}. Now you can write
print @foo;
... and have it work DWIM. Or use the bare foo as reference. But the problem is, if foo refers to code you'll need explicit () to make the call. Hmm. And then, is $doh->foo() a method call or autoboxing? There are probably many caveats I can't think of. So you may be right that this feature wouldn't integrate well.

Anyhow, the more compact syntax would see more use. Isn't this all about hubrislaziness after all?

2017-04-01 Embarrassing. I think laziness but write hubris, some times. Blame perl!

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2019-11-13 17:31 GMT
Find Nodes?
    Voting Booth?
    Strict and warnings: which comes first?

    Results (74 votes). Check out past polls.