10.07.2015 Views

Beginning Web Development With Perl : From Novice to ... - Nabo

Beginning Web Development With Perl : From Novice to ... - Nabo

Beginning Web Development With Perl : From Novice to ... - Nabo

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

■CONTENTSixCreating a SOAP Listener. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146Consuming a SOAP <strong>Web</strong> Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148Calling Your SOAP Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148Calling the National Weather Service SOAP Service . . . . . . . . . . . . 149Security Considerations with SOAP <strong>Web</strong> Services. . . . . . . . . . . . . . . . . . . 152Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152■CHAPTER 8 <strong>Perl</strong> and RSS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153RSS: Versioning Fun . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153Reading RSS with XML::RSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154Parsing RSS Feeds. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155Debugging RSS Scripts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158Writing RSS with XML::RSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159Security Considerations with RSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163■CHAPTER 9 XML Parsing with <strong>Perl</strong> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165XML Parsing Methods. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165XML Parsing Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166Parsing XML with XML::Simple . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166Data::Dumper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168XML::Simple Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170Parsing XML with XML::SAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172XML::SAX Parser Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173SAX2 Handler Interfaces. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173A Basic Parser and Handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175Using Tree-Based Parsing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179Security Considerations with XML Parsing . . . . . . . . . . . . . . . . . . . . . . . . . 180Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180PART 4 ■ ■ ■ Performance Enhancementwith mod_perl■CHAPTER 10 Apache and mod_perl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183How Apache Handles Requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183Apache’s Child Processes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184Forking. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!