Cool/useful short examples of Perl?
David Matthewman
david at matthewman.org
Thu Jun 9 15:39:45 BST 2011
On 9 Jun 2011, at 15:16, David Landgren wrote:
> I had all the parts lying around, but didn't realise they were germane to the problem. So, thanks for the cogent explanation.
You're welcome. ;-)
This effect means that:
if (!something)
and
unless(something)
don't do the same thing either, whereas from the 'overloaded operator' point-of-view *as far as I can tell* they do the same thing. The 'unless' statement runs the overloaded '!' subroutine of the class in question, as opposed to doing a 'bool' conversion on the class and doing a logical NOT on the result of that, which is the other thing it *might* be expected to do.
I just wrote a class to check this. It claims that everything is true (especially the lies), and is called 'Garak', ;-)
--
David Matthewman
More information about the london.pm
mailing list