#!C:perlinperl-wusestrict;useLWP::Simple;useCGIqw(:standard);my$url="http://slashdot.org/slashdot.xml";my$cache="cache";printheader;#savetheresultsinthecachefilemy$doc=get($url);if(defined$doc){open(CF,">$cache")||die"writingtocache:$!";printCF$doc;closeCF;}#parsetheXMLfileandoutputtheTITLEandURLprint"<h2>slashdot.org'sheadlinesasof</h2>";open(CF,$cache)||die"cannotopenthecache:$!";my($title,$link);while(<CF>){if(m,<title>(.*)</title>,){$title=$1;}if(m,<url>(.*)</url>,){$link=$1;printqq(<ahref="$link">$title</a><br/>n);}}closeCF;