Re: Question from the perlmod man pages.



"grocery_stocker" <cdalten@xxxxxxxxx> wrote:
Jim Gibson wrote:
No, there need not be a module named Text.pm. The pattern A::B is a
naming convention, and does not establish a hierarchical relationship
between modules A and B or their symbol tables. See 'perldoc perlmod'
for details.

The source of this confusion stems from the following lines of code:

#!/usr/bin/perl

# change these two lines
$server_port = 1234;
$identification_phrase = 'insert phrase here';

# redirect error messages to a logfile
open(STDERR, ">>/tmp/logserver.log");

# code stolen liberally from Perl Cookbook

use IO::Socket;

....

$server = IO::Socket::INET->new(LocalPort => $server_port,
....


Why go

use IO::Socket;

Why just not

use IO::Socket::INET;

in this case

No particular reason that I can think of. When you use IO::Socket, it
automatically uses IO::Socket::INET for you. That is just the kind of
relationship that IO::Socket and IO::Socket::INET have with each other.
Other modules have a more stand-offish relationship.


OK, maybe one reason to use IO::Socket rather than IO::Socket::INET is
that, if you decide to switch to the different kind of socket, (say, UNIX)
then you would only need to change the "new" line rather than changing both
the "new" and the "use".

Xho

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
.