Scalar::Properties

unimatrix on 2001-06-27T22:40:25

After reading a journal entry here, James Duncan sent me some pretty cool code showing how to get constant overloading and literals-as-objects working as intended. At that point, Scalar::Properties had become an inevitability. Let me amuse you with an excerpt of the module's synopsis:

use Scalar::Properties; my $val = 0->true; if ($val && $val == 0) { print "yup, its true alright...\n"; }

my @text = ( 'hello world'->greeting(1), 'forget it', 'hi there'->greeting(1), ); print grep { $_->is_greeting } @text;

my $l = 'hello world'->length;