Re: Why does Tie::Simeple (scalar) work without real local data?



"JWK" == John W Krahn <someone@xxxxxxxxxxx> writes:

JWK> Uri Guttman wrote:
>>>>>>> "JWK" == John W Krahn <someone@xxxxxxxxxxx> writes:

JWK> If you increment a reference it *becomes* a number and cannot be
JWK> changed back to a reference. Likewise, if you stringify a
JWK> reference it cannot be changed back to a reference.

>> the difference with the OP's code is that ++ will change the ref value
>> to a number and store it back into $x and then the ref is lost
>> forever. just using a ref in some expression without modifiying it will
>> not change the ref.

JWK> That's what I thought I was saying. Unfortunately the code I
JWK> used did not convey that point. :)

well you didn't say it in english either. the first quoted paragraph
above say stringifying will convert a ref and not be allowed to convert
back. i was correcting that and also the example code.

uri

--
Uri Guttman ------ uri@xxxxxxxxxxxxxxx -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
.



Relevant Pages

  • Re: Why does Tie::Simeple (scalar) work without real local data?
    ... JWK> No, when a reference is used as a number it becomes a number: ... JWK> If you increment a reference it *becomes* a number and cannot be ... Likewise, if you stringify a ... the ref is still valid there. ...
    (comp.lang.perl.modules)
  • Re: Why does Tie::Simeple (scalar) work without real local data?
    ... JWK> No, when a reference is used as a number it becomes a number: ... JWK> If you increment a reference it *becomes* a number and cannot be ... Likewise, if you stringify a ... the ref is still valid there. ...
    (comp.lang.perl.modules)
  • Re: Using C++ Classes in ASP.NET
    ... When you select Add Reference and then click on the tab labelled Project, ... does it no chow the class library project there? ... MattC ... "jwk" wrote in message ...
    (microsoft.public.dotnet.framework.aspnet)