On Sun, 16 Sep 2012, [email protected] wrote: >--- On Sat, 9/15/12, Philip Prindeville <[email protected]> >wrote: >> On 9/14/12 12:20 PM, [email protected] wrote: >> > --- On Thu, 9/13/12, Philip Prindeville >> > <[email protected]> >> wrote: >> >> $offset = -1 unless defined($offset); >> >> Seem reasonable? >> > >> > No: Possibly deprecated construct under perl 5.14. [5.16 - sic] >> >> So since this only affects arrays and hashes, then we're good? > >Perhaps, but I'm still not certain that such was actually confirmed. >An actual citation from the perl site would be the best evidence.
Though I didn't cite the warning, I _did_ mention a perl site: http://perldoc.perl.org/functions/defined.html. That site shows the documentation of the defined function for version 5.16.0. And even perldoc v5.12.3 --installed on my own workstation-- says: ~$ perldoc -f defined defined EXPR defined Returns a Boolean value telling whether EXPR has a value other than the undefined value "undef". If EXPR is not present, $_ is checked. [...] Use of "defined" on aggregates (hashes and arrays) is deprecated. It used to report whether memory for that aggregate has ever been allocated. This behavior may disappear in future versions of Perl. You should instead use a simple test for size: if (@an_array) { print "has array elements\n" } if (%a_hash) { print "has hash members\n" } [...] Regards, Kees Theunissen. -- Kees Theunissen, System and network manager, Tel: +31 (0)30 6096724 Dutch Institute For Fundamental Energy Research (DIFFER) e-mail address: [email protected] postal address: PO Box 1207, 3430 BE Nieuwegein, NL visitors address: Edisonbaan 14, 3439 MN Nieuwegein, NL _______________________________________________ NOTE: If there is a disclaimer or other legal boilerplate in the above message, it is NULL AND VOID. You may ignore it. Visit http://www.mimedefang.org and http://www.roaringpenguin.com MIMEDefang mailing list [email protected] http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

