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

Re: What operator should perl5porters use for safe dereferencing?

by pvaldes (Chaplain)
on Jun 13, 2012 at 11:09 UTC ( #975955=note: print w/replies, xml ) Need Help??

in reply to What operator should perl5porters use for safe dereferencing?

mmmh, I think that I had an interesting idea...

This is a safety kit:

Is iconic, simple and universally understood

So what if instead something like ~> we consider something like [+]>?

We could to teach emacs or vim to print this 3 chars in red so is more readable that other options and thus you can't mistake for a part of a sum, is a red cross in a box, everybody can catch this idea in seconds

If you want SAFE dereference simply add a safety kit "[+]" to your code:

I don't know if this could horribly crash with another internal or external perl structures (don't think that the combo [+]> should be frequently seen in a regex anyways) but looks a simple, elegant, easy to remember and strong concept to me, and not to much ugly to read, specially if we use an editor that can print this 3 characters in red if found before a ">".

 [+]>     $rock->()->the->kasbah();     $rock[+]>  ()[+]>  the[+]>   kasbah();

What dou you think about it?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://975955]
[Discipulus]: i just, rarely, downvote unpolite posts and spam, and wrong advices
[Discipulus]: discutere in eatalian is neutral: but discutere with wife sounds implicitly negative..
[erix]: what's the offending signature?
[Discipulus]: 'give man a fish erix it sonds like a push towards omosexuality.. ;=)
[Discipulus]: see Re: from txt file to array erix
[erix]: yeah, I ask for the text (I don't see signatures)

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2017-06-22 12:26 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (519 votes). Check out past polls.