More Mac::Glue Syntax Coolness
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:
Another example, moving word 8 of an AppleWorks document to after word 9:
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(is now this:
$appleworks->obj(word => 8 => $text),
to => location(after => $appleworks->obj(word => 9 => $text))
);
$text->obj(word => 8)->move(
to => location( after => $text->obj(word => 9) )
);
Leave a comment