Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Perl: porters

[perl #88740] RFE: allow length(undef)=>0 (w/no warnings)

 

 

Perl porters RSS feed   Index | Next | Previous | View Threaded


perlbug-followup at perl

Jul 3, 2012, 6:09 PM

Post #1 of 2 (89 views)
Permalink
[perl #88740] RFE: allow length(undef)=>0 (w/no warnings)

undef in numeric context evaluates to 0, so your example of summing up a
bunch of lengths will still work identically (although the warning that
is generated is now "Use of uninitialized value in addition (+)" instead
of "Use of uninitialized value in length". Also, if you want to suppress
the warning, previously you had to do "(defined($str) && length($str))
|| 0", where now you can do just "length($str) || 0", since passing
undef to length no longer warns. I'm inclined to close this ticket,
unless anyone can see anything here that should be done.

-doy

---
via perlbug: queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=88740


perlbug-comment at perl

Jul 3, 2012, 6:18 PM

Post #2 of 2 (88 views)
Permalink
[perl #88740] RFE: allow length(undef)=>0 (w/no warnings) [In reply to]

In that case, closing.

-doy

Perl porters RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.