Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

unimatrix (1124)

unimatrix
  (email not shown publicly)
http://www.codewerk.com

Journal of unimatrix (1124)

Wednesday June 27, 2001
05:40 PM

Scalar::Properties

[ #341 ]

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;