|Just another Perl shrine|
Re^4: Hash key composition with a comma? (Semipredicate problem)by LanX (Archbishop)
|on Mar 17, 2018 at 22:19 UTC||Need Help??|
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.
*) 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.