in reply to Re: How does ~~ force string interpolation of code into scalar context?
in thread How does ~~ force string interpolation of code into scalar context?
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: How does ~~ force string interpolation of code into scalar context?
by sauoq (Abbot) on Oct 26, 2003 at 05:40 UTC |