Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

if ( {} > 2.2) { print "yes\n"; }
Somehow the above just doesn't feel right, particularly for floats. Monks - enlighten me to the application.

Replies are listed 'Best First'.
Re: Comparison of empty hash references to numbers
by moritz (Cardinal) on Apr 15, 2010 at 13:55 UTC
    If you use a reference in numeric context, it returns the memory address. This can be used for testing if two references point to the same location. Comparing it with > to a number doesn't really make sense.