Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Check if object at start of array

by RMGir (Prior)
on Mar 17, 2009 at 14:53 UTC ( #751216=note: print w/replies, xml ) Need Help??


in reply to Check if object at start of array

I suggest reading perlref and searching for "cheap numeric compare of references"...

Mike

Replies are listed 'Best First'.
Re^2: Check if object at start of array
by ikegami (Pope) on Mar 17, 2009 at 14:58 UTC

    That will work in most circumstances, but note these exceptions:

    The linked code can produce undesirable results (false positives, false negatives) if the inserted object or an object in the array overrides numification or numerical equivalency.

    The linked code can produce undesirable results (false positives, warnings) if the array contains non-references.