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

Update in perlop

Thread Next
Balasundaram, Prateek
September 4, 2013 18:52
Update in perlop
Message ID:
Hello all,

In the section:

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.

Prateek Balasundaram


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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About