Chapter 7
with C code (which you'll learn about in the next few chapters). As a result,
Storable was able to offer serialization at a greatly reduced runtime cost.
Storable is a great example of doing one thing and doing it well. As such,
Storable has become the basis for many other modules that add services on top of
basic serialization.
Another key to Storable's success is the simplicity of its interface. All you need
to get full use out of the module are two functions store() and retrieve() both
of which are exported by default. More complicated usages are supported by a
handful of extra functions that can be imported by request. Contrast this with
Data::Dumper, which offers a slightly greater range of functionality, but at the
price of a confusing functional and OO interface that uses an odd convention for
subroutine naming (Dumper() and Data::Dumper >Dump(), for example).
A testament to Storable's success is that when Raphael recently announced his
retirement from the Perl community, the perl5 porters
15
took over maintenance of
Storable. Storable is now included as a core Perl module.
Net::FTP
The Net::FTP module by Graham Barr is just one of a collection of modules offered
in the libnet package. Net::FTP offers an object oriented interface to the client
side
16
of the FTP
17
protocol. With Net::FTP, users can write scripts that upload and
download files from FTP servers with extreme ease.
Net::FTP is successful first and foremost because it answers a very common
need. However, the module also benefits from an exceptionally clear interface.
Learning the module is easy, and, better yet, the payoff is bigger than just learning
to FTP files with Perl. This is because Net::FTP is implemented as a child class of
both Net::Cmd and IO::Socket::INET (both also by Graham Barr). Once a user has
learned Net::FTP, the other modules in the libnet distribution Net::SMTP,
Net::POP3 and Net::NNTP to name a few will be easy for that user to pick up.
Net::FTP demonstrates the power of a careful use of inheritance to create a
group of modules that share common base functionality. Overall Graham's
modules are models of code clarity and object oriented design. Anyone interested
in implementing network protocols in Perl would benefit from a close exami
nation of Net::FTP and the other modules in libnet.
15. The perl5 porters are responsible for the maintenance and development of Perl 5.
16. For the server side, see the excellent Net::FTPServer module by Richard Jones, Rob Brown,
Keith Turner and Azazel.
17. File Transfer Protocol, an internet protocol for transferring files. See RFC 959, available at
http://rfc editor.org.
170
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved