perl Archives

Not to Hot for Mojo

I saw a post out in the Blogosphere today about getting weather info from NOAA (The United States National Weather Service). Oh! the horrors of using XML::LibXML or XML::DOM or those other hairy XML modules to get at the data.

The blogger didn't seem to keen on my quick and dirty Mojolicious solution:

$ perl -Mojo -E 'say g("http://w1.weather.gov/xml/current_obs/KBUR.xml")->dom("temp_f")->first->text'
76.0

I guess I was a bit too brief and off the point, so here's a nicer example:

About zengargoyle

user-pic