O'Reilly logo

Perl Cookbook by Nathan Torkington, Tom Christiansen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 18. Internet Services

Introduction

This “telephone” has too many shortcomings to be seriously considered as a means of commmunication. The device is inherently of no value to us.

Western Union internal memo, 1876

Correct use of sockets is only part of network communicating programs. Once you have a way for two programs to talk, you still need a protocol for communication. This protocol lets each party know when to talk, and it precisely defines who is responsible for which part of the service.

Common Internet protocols are:

Protocol

Meaning

Action

FTP

File Transfer Protocol

Copying files between remote machines

telnet

 

Remote login

rsh and rcp

Remote shell and Remote copy

Remote login and remote file copying

NNTP

Network News Transfer Protocol

Reading and posting USENET news

HTTP

Hypertext Transfer Protocol

Transferring documents on the Web

SMTP

Simple Mail Transfer Protocol

Sending mail

POP3

Post Office Protocol

Reading mail

Even something as relatively simple as connecting to a remote computer requires intricate negotiations between client and server and has numerous dynamically configurable options. If you had to write the Perl code to implement these protocols each time you wanted to use a network service, you’d probably end up writing a lot of buggy programs, try to get demoted into a management position, or both.

Fortunately, CPAN has modules for these protocols. Most modules implement the client side of the protocol rather than the server side. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required