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

Re^3: Strange behaviour of tr function in case the set1 is supplied by a variable

by Anonymous Monk
on Nov 16, 2017 at 09:40 UTC ( [id://1203572]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Strange behaviour of tr function in case the set1 is supplied by a variable
in thread Strange behaviour of tr function in case the set1 is supplied by a variable


What is a "// string"?
We have tr///ansliteration operator,
m//atch operator,
s///ubstitution operator,
qr//egex operator,
q//uote and qq//uote operator,
and only the firstr// one is rare.
A special warnings is moot?
Cause I mean you found out
without a special warnings tr/// wasnt doing what you wanted --
oh noes I made mistake, perl should have held my hand and kissed my booboo and spoon fed me wisdom and knowledge and wrote my program for me.
You can have Tr('list','replacement,'options') anytime you want,
simply stop shifting responsibility for your ignorance on the designers of the language.

I've been in the same exact boat more than once,
wrote something,
couldn't figure out what mistake I was making , posted about it,
what you have to do is learn from it,
take responsibility for your own knowledge,
write a perlcritic policy (its easy) to remind you in case you forget.

 

Information is not Knowledge. Knowledge is not Wisdom. Wisdom is not Truth. Truth is not Beauty. Beauty is not Love. Love is not Music.

Music is the best.

clap your hands everybody, everybody clap your hands

Replies are listed 'Best First'.
Re^4: Strange behaviour of tr function in case the set1 is supplied by a variable
by likbez (Sexton) on Nov 16, 2017 at 22:56 UTC
    I am talking about adding a simple warning, if symbols "[" and "$" in tr set1 or set2 are not backlashed (backslashing them is allowed in current version of Perl; also there is no break of compatibility with the old code here).

    That's around a dozen of lines of code in C-language.

    IMHO adding such a warning makes sense and this is a constructive suggestion, not blank critique of the language, as you assume. Your mileage may vary.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-03-29 07:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found