Mac::Glue Syntax Revisited

pudge on 2003-05-18T23:37:56

It hit me in the car today ... I had simplified this:

$itunes->get( $itunes->prop(location => $track) )

to this:

$itunes->get( $track->prop('location') )

But $track->prop('location') also returns an object just like $track (an Apple event object descriptor object, in the class Mac::AEObjDesc), so I can simplify it further to:

$track->prop('location')->get

That is so cool. I've always hated wrapping obj and prop calls in $glue->get(). I just have to think of a reason why this would be a bad idea, but it looks good to me, and works dandily.