2009年3月23日星期一

to explain what is JSON

pp -M English -e 'use LWP::Simple; use JSON; use HTML::Entities; $OFS=$RS;print map {"@{[decode_entities $_->{text}]}\n"} @{jsonToObj(get("http://twitter.com/statuses/user_timeline/perloneliner.json"))}' -o bin/pol

interesting things in pp learned these days:
  • It do not support user defined global variables
  • It support English pervar
  • It's -M do not export subroutine so nice
  • It's not perfectly version portable (especially between linux perl versions)
  • With pp you don't need to worry about install cpan version APP::BLT :)

没有评论: