Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re^4: Hash key composition with a comma? (Semipredicate problem)

by LanX (Cardinal)
on Mar 17, 2018 at 22:19 UTC ( #1211165=note: print w/replies, xml ) Need Help??

in reply to Re^3: Hash key composition with a comma?
in thread Hash key composition with a comma?

It's a variation of the Semipredicate problem.

Another variation are Null-terminated strings in C. *

In other words, if you use a "special" value (here the delimiter) you have to make sure that the input (here keys) can't include them, and that's why you even have the freedom to chose the delimiter by setting $;

Such approaches happen constantly in programming and people make sure that such values are excluded, IFF they need the benefits. (For example by escaping or the choice of delimiter in q , qq or even << here-docs.)

Calling for deprecation doesn't make sense here, since one doesn't easily and accidentally stumble over this feature.

It's similar to goto , it's rarely used, doesn't cause problems, but is sometimes extremely handy to simplify an algorithm, where speed matters.

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Wikisyntax for the Monastery

*) and yes I once got bitten by this because a badly written WMLScript interpreter couldn't distinguish between a NULL byte and the ASCII character "0". But this interpreter was buggy, there was otherwise no possibility to introduce a NULL-byte into a string.

  • Comment on Re^4: Hash key composition with a comma? (Semipredicate problem)

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2020-10-01 01:27 GMT
Find Nodes?
    Voting Booth?
    If at first I donít succeed, I Ö

    Results (172 votes). Check out past polls.