In fact, it works in exactly the same way against integer and string.Does not. Try this:
Result:$\ = "\n"; print ~3; print ~"3";
4294967292 ÌNow, if it worked exactly the same way for integers and for strings, how come the intermediate result is different?
I stand by my point: even though they work differently (as shown here), the net result of the double not is exactly the same for both: the original value. That means that an integer produces the original integer, and that a string produces the original string.
Perhaps you mean something other than I do?
In reply to Re: Re: How does ~~ force string interpolation of code into scalar context?
by bart
in thread How does ~~ force string interpolation of code into scalar context?
by davido
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |