Mac::Glue Syntax Revisited

| | Comments (0)
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. use.perl.org

Leave a comment

<pudge/*> (pronounced "PudgeGlob") is thousands of posts over many years by Pudge.

"It is the common fate of the indolent to see their rights become a prey to the active. The condition upon which God hath given liberty to man is eternal vigilance; which condition if he break, servitude is at once the consequence of his crime and the punishment of his guilt."

About this Entry

This page contains a single entry by pudge published on May 18, 2003 4:37 PM.

iTunes Duplicates, Mac::Glue Syntax was the previous entry in this site.

More Mac::Glue Syntax Coolness is the next entry in this site.

Find recent content on the main index or look in the archives to find all content.