Is is obvious to you how this works?
Update: the print statements are only intended to demonstrate that the constants created act like perl's built in boolean return values (where false is dual-valued as 0 and ""). There's nothing complex about them.#!/usr/bin/perl -wl use constant FALSE, !TRUE; use constant TRUE, !FALSE; use strict; print "false is \"", FALSE, "\" in string context"; print "false is ", 0+FALSE, " in numeric context"; print "true is ", TRUE; __END__ output: false is "" in string context false is 0 in numeric context true is 1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: circular boolean constants
by Coruscate (Sexton) on Jan 22, 2004 at 05:27 UTC |