From: Gerry Ford on
Hello c.l.p.misc!

A resurgence of spam in places I would otherwise like has renewed my
interest in writing an nntp client. Someone else's (in the public domain)
has the following use statements, which I think I have to track down now.
The part I don't get right now is what follows the vanilla use statements

use strict; <---- this one I get for free
use Net::NNTP; <----already got this one
use Net::SMTP;
use HTTP::Date qw/time2str str2time/;
use MIME::QuotedPrint qw/encode_qp decode_qp/;
use Encode qw/encode decode/;
use POSIX qw/strftime/;
use File::stat;
use File::Temp qw/:mktemp/;
use Win32::ANSIConsole qw/coninit cls/;
, such as ^^^^^^^^.

What does it mean?

TIA, and cheers,

--
"Shopping for toilets isn't the most fascinating way to spend a Saturday
afternoon. But it beats watching cable news."

~~ Booman


From: smallpond on
On Apr 14, 1:25 am, "Gerry Ford" <ge...(a)nowhere.ford> wrote:
> Hello c.l.p.misc!
>
> A resurgence of spam in places I would otherwise like has renewed my
> interest in writing an nntp client. Someone else's (in the public domain)
> has the following use statements, which I think I have to track down now.
> The part I don't get right now is what follows the vanilla use statements
>
> use strict; <---- this one I get for free
> use Net::NNTP; <----already got this one
> use Net::SMTP;
> use HTTP::Date qw/time2str str2time/;
> use MIME::QuotedPrint qw/encode_qp decode_qp/;
> use Encode qw/encode decode/;
> use POSIX qw/strftime/;
> use File::stat;
> use File::Temp qw/:mktemp/;
> use Win32::ANSIConsole qw/coninit cls/;
> , such as ^^^^^^^^.
>
> What does it mean?
>
> TIA, and cheers,



I gather you are new to perl. The "qw/coninit cls/" is a way
of specifying a list, which is a basic perl data type.
If you look at the documentation for "use" which you can find
online, it shows the different forms:

use Module VERSION LIST
use Module VERSION
use Module LIST
use Module
use VERSION

The documentation describes what the LIST argument is for. See:

http://aspn.activestate.com/ASPN/docs/ActivePerl
http://aspn.activestate.com/ASPN/docs/ActivePerl/5.10/lib/pods/perlfunc.html#use

perlfunc has the documentation for each perl function call,
including "use". If you have perldoc, you can get the
same documentation with the command:

perldoc -f use
From: Tad J McClellan on
Gerry Ford <gerry(a)nowhere.ford> wrote:


> The part I don't get right now is what follows the vanilla use statements


> use HTTP::Date qw/time2str str2time/;

> What does it mean?


perldoc -f use


--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
From: Gerry Ford on

"smallpond" <smallpond(a)juno.com> wrote in message
news:eae5c9e5-b162-40ab-9a6e-77ae04a9e18c(a)m3g2000hsc.googlegroups.com...

>> use strict; <---- this one I get for free
>> use Net::NNTP; <----already got this one
>> use Net::SMTP;
>> use HTTP::Date qw/time2str str2time/;
>> use MIME::QuotedPrint qw/encode_qp decode_qp/;
>> use Encode qw/encode decode/;
>> use POSIX qw/strftime/;
>> use File::stat;
>> use File::Temp qw/:mktemp/;
>> use Win32::ANSIConsole qw/coninit cls/;
>> , such as ^^^^^^^^.

> I gather you are new to perl. The "qw/coninit cls/" is a way
> of specifying a list, which is a basic perl data type.

Thanks for your reply, smallpond. I'm newly-new to perl. Let me see if
I've got this:

use module LIST;
Imports some semantics into the current package from the named module,
generally by aliasing certain subroutine or variable names into your
package. It is exactly equivalent to
BEGIN { require Module; Module->import( LIST ); }

So I'm to look at importing/exporting. qw is the quote word operator. So
if you have
@fruits = qw{ apple orange banana};
, your list is correctly instantiated sans commas. So
use Win32::ANSIConsole qw/coninit cls/;
imports the coninit and cls functions.

Here's where I run into double trouble. I'm having a heckuva time figuring
out what he means with win32::ansiconsole. I thought that the reason I
might not be able to find any of these is that I had an outdated activestate
install, but not so. Overnight I upgraded to 5.10 and find many modules
that look like this one, that aren't. AS has no entry for net::nntp nor
win32::ansiconsole. Without the module for me to look at, I'm not gonna
figure out what, e.g. coninit is.

What's puzzling is that I'm able to use net::nntp having downloaded nothing
but AS 5.10. I looked in the installed modules and see no reason for this
good fortune.

> perlfunc has the documentation for each perl function call,
> including "use". If you have perldoc, you can get the
> same documentation with the command:
>
> perldoc -f use
Indeed I do. I can use it on any dos prompt. I'm a little mystified by
this good fortune as well.

Given that I'm gonna have a dozen knucklehead questions like this, should I
rather ask in c.l.p.modules?
--
"Shopping for toilets isn't the most fascinating way to spend a Saturday
afternoon. But it beats watching cable news."

~~ Booman


From: A. Sinan Unur on
"Gerry Ford" <gerry(a)nowhere.ford> wrote in
news:1208216001_0(a)news.newsgroups.com:


> Here's where I run into double trouble. I'm having a heckuva time
> figuring out what he means with win32::ansiconsole.

Please capitalize module names properly. Case matters.

In any case, I am not sure but I am assuming it is an
version of the following module:

http://search.cpan.org/~jlmorel/Win32-Console-ANSI-1.00/

If you cannot find that through ppm, you might want to
add the following repositories:

Name: uwinnipeg
URL: http://cpan.uwinnipeg.ca/PPMPackages/10xx/package.xml

Name: trouchelle
URL: http://trouchelle.com/ppm10/package.xml

Name: Bribes
URL: http://www.bribes.org/perl/ppm/package.xml

> that aren't. AS has no entry for net::nntp

perl -MNet::NNTP -e "print qq{$Net::NNTP::VERSION\n}"

will print the version installed (assuming it is installed).

You can see at http://perldoc.perl.org/index-modules-N.html
that both Net::NNTP and Net::SMTP are core modules.

> win32::ansiconsole. Without the module for me to look at, I'm not
> gonna figure out what, e.g. coninit is.

E:\Home\asu1> ppm install Win32::Console::ANSI
Downloading Win32-Console-ANSI-1.00...done
Unpacking Win32-Console-ANSI-1.00...done
Generating HTML for Win32-Console-ANSI-1.00...done
Updating files in site area...done
7 files installed

This module seems to be available at both Bribes and trouchelle repos.

On the other hand, you can download the original module from:

http://backpan.perl.org/authors/id/J/JL/JLMOREL/

http://backpan.perl.org/authors/id/J/JL/JLMOREL/Win32-ANSIConsole-0.01.tar.gz

> What's puzzling is that I'm able to use net::nntp having
> downloaded nothing but AS 5.10. I looked in the installed modules
> and see no reason for this good fortune.

It is in the core.

> Given that I'm gonna have a dozen knucklehead questions like this,
> should I rather ask in c.l.p.modules?

Nope. This is a fine place to ask.

However, do read the posting guidelines first.

Sinan

--
A. Sinan Unur <1usa(a)llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/