Perl Intervention

by Erica Sadun

Andy Lester, fellow OReillyNet blogger and Perl Foundation PR-person kindly performed a quick makeover on my iTunes command-line country-changing code. He writes, "It now uses warnings and strictures to enforce better coding habits, and no longer uses a deprecated hash feature that I'm sure you didn't mean to use."



Download a copy of the renovated code here.



Thanks, Andy!


1 Comments

Johnny!
2006-04-26 18:42:27
Hello,


This could be improved by changing the http:// in the beginning of the url to itms://


Also, instead of using
-- osascript -e 'tell application "Safari" to set URL of document 1 to "$url"' --


you should use
-- osascript -e 'tell application "System Events" to open location "$url"' --


From what I've seen this wouldn't require Safari to be open.