in reply to All array elements the same?

The example of davorg took my breath away for its elegance, but as I read further I realized something. It wont work on nested structures correctly.

If the values in a nested structure are equal in value but not in reference, then his method will return false because the number of keys if greater than 1.

Replies are listed 'Best First'.
RE: Re: All array elements the same?
by davorg (Chancellor) on Aug 02, 2000 at 12:45 UTC

    You're absolutely right of course, but I think that all the proposed solutions will fail for the same reason. If you have an arrary containing data structures then you'd need to serialise it first using something like Data::Dumper or FreezeThaw.

    --
    <http://www.dave.org.uk>

    European Perl Conference - Sept 22/24 2000, ICA, London
    <http://www.yapc.org/Europe/>