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 ]

pudge (1)

pudge
  (email not shown publicly)
http://pudge.net/
AOL IM: Crimethnk (Add Buddy, Send Message)

I run this joint, see?

Journal of pudge (1)

Monday May 19, 2003
06:50 PM

More Mac::Glue Syntax Coolness

[ #12316 ]

I love it when you can do something that just makes sense. All I did was make an AUTOLOAD for AEObjDesc objects so that it would use that object as the direct object of the parent glue's method of the same name, and it works so well in ways I hadn't even considered. I think that's a sign that it this is indeed a good idea.

The latest example -- setting the subject of a Eudora mail document -- is that this:

$eudora->set( $e->obj(field => 'Subject:', $mail), to => 'Alert!' );

is now this:

$mail->obj(field => 'Subject:')->set(to => 'Alert');

$mail is the direct object of the obj() method, and the Subject field of $mail (returned by obj()) is the direct object of the set() method.

Another example, moving word 8 of an AppleWorks document to after word 9:

$appleworks->move(
    $appleworks->obj(word => 8 => $text),
    to => location(after => $appleworks->obj(word => 9 => $text))
);

is now this:

$text->obj(word => 8)->move(
    to => location( after => $text->obj(word => 9) )
);

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.