develooper Front page | perl.perlfaq.workers | Postings from September 2013

Update in perlop

Thread Next
From:
Balasundaram, Prateek
Date:
September 4, 2013 18:52
Subject:
Update in perlop
Message ID:
D3FCBE763F45014A8CE908187F5E7306AEA3FB@xchmbbal505.ds.susq.com
Hello all,

In the section: http://perldoc.perl.org/perlop.html#Auto-increment-and-Auto-decrement

I believe this line is incorrect:
"undef is always treated as numeric, and in particular is changed to 0 before incrementing (so that a post-increment of an undef value will return 0 rather than undef)."

Upon testing:
$ perl -le '$val=undef;print("Initial Value: $val");$val++;print("Incremented Value: $val");'
Initial Value:
Incremented Value: 1

It seems that the post-increment value of undef will be 1, not 0 as the documentation states.

Regards,
Prateek
--
Prateek Balasundaram
prateek.balasundaram@sig.com
(484)562-1281



________________________________

IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About