I've looked in perlop and find no mention of ~~. A single ~ is the bitwise negation operator. But I don't think that has anything to do with ~~.
Actually, that's exactly what it has to do with. The ~~ is two bitwise negations. The first one forces its argument to be evaluated in scalar context and negates it. The second one undoes the first's negation.
Note that it won't work on references.
Update: It won't work with floating point numbers either, as bart rightfully points out.
-sauoq "My two cents aren't worth a dime.";
In reply to Re: How does ~~ force string interpolation of code into scalar context?
by sauoq
in thread How does ~~ force string interpolation of code into scalar context?
by davido
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |