[30198] in Perl-Users-Digest
Perl-Users Digest, Issue: 1441 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 15 15:46:12 2008
Date: Tue, 15 Apr 2008 12:46:03 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 15 Apr 2008 Volume: 11 Number: 1441
Today's topics:
modules for nntp client <gerry@nowhere.ford>
Re: modules for nntp client <smallpond@juno.com>
Re: modules for nntp client <tadmc@seesig.invalid>
Re: modules for nntp client <gerry@nowhere.ford>
Re: modules for nntp client <1usa@llenroc.ude.invalid>
Re: modules for nntp client <gerry@nowhere.ford>
Re: modules for nntp client <1usa@llenroc.ude.invalid>
Re: modules for nntp client <gerry@nowhere.ford>
Re: modules for nntp client <1usa@llenroc.ude.invalid>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 14 Apr 2008 00:25:14 -0500
From: "Gerry Ford" <gerry@nowhere.ford>
Subject: modules for nntp client
Message-Id: <1208150272_40984@news.newsgroups.com>
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
------------------------------
Date: Mon, 14 Apr 2008 08:14:47 -0700 (PDT)
From: smallpond <smallpond@juno.com>
Subject: Re: modules for nntp client
Message-Id: <eae5c9e5-b162-40ab-9a6e-77ae04a9e18c@m3g2000hsc.googlegroups.com>
On Apr 14, 1:25 am, "Gerry Ford" <ge...@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
------------------------------
Date: Mon, 14 Apr 2008 23:16:03 GMT
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: modules for nntp client
Message-Id: <slrng06hbt.pbt.tadmc@tadmc30.sbcglobal.net>
Gerry Ford <gerry@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/"
------------------------------
Date: Mon, 14 Apr 2008 18:40:41 -0500
From: "Gerry Ford" <gerry@nowhere.ford>
Subject: Re: modules for nntp client
Message-Id: <1208216001_0@news.newsgroups.com>
"smallpond" <smallpond@juno.com> wrote in message
news:eae5c9e5-b162-40ab-9a6e-77ae04a9e18c@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
------------------------------
Date: Tue, 15 Apr 2008 00:05:35 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: modules for nntp client
Message-Id: <Xns9A80CC6552B84asu1cornelledu@127.0.0.1>
"Gerry Ford" <gerry@nowhere.ford> wrote in
news:1208216001_0@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@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/
------------------------------
Date: Mon, 14 Apr 2008 23:56:19 -0500
From: "Gerry Ford" <gerry@nowhere.ford>
Subject: Re: modules for nntp client
Message-Id: <1208234940_6@news.newsgroups.com>
"Tad J McClellan" <tadmc@seesig.invalid> wrote in message
news:slrng06hbt.pbt.tadmc@tadmc30.sbcglobal.net...
> Gerry Ford <gerry@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
This is the current contents of my Path system variable:
C:\Program Files\perl3\site\bin;C:\Program
Files\perl3\bin;c:\path\gcc\bin;C:\Program
Files\Silverfrost\FTN95;C:\Perl\site\bin;C:\Perl\bin;c:\ruby\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem
This is, BTW, something that AS perl users on windows need to go in and trim
after installations. The installation that is right off the root I'll trim
out (it's 5.8). It confuses the heck out of windows and linkers at
precisely the wrong time to have one path to one installation and another to
an older one, in particular, in reverse order.
I was wondering why I can use perldoc from a dos window anywhere, and see
that the answer is that the path leads to the binaries, wherein we see
perldoc.bat. I wouldn't have believed for a second that this is how I get
output with the perldoc command:
@rem = '--*-Perl-*--
@echo off
if "%OS%" == "Windows_NT" goto WinNT
perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofperl
:WinNT
perl -x -S %0 %*
if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
if %errorlevel% == 9009 echo You do not have Perl in your PATH.
if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul
goto endofperl
@rem ';
#!perl
#line 15
eval 'exec C:\Program Files\perl3\bin\perl.exe -S $0 ${1+"$@"}'
if 0;
# This "perldoc" file was generated by "perldoc.PL"
require 5;
BEGIN { $^W = 1 if $ENV{'PERLDOCDEBUG'} }
use Pod::Perldoc;
exit( Pod::Perldoc->run() );
__END__
:endofperl
--
"Shopping for toilets isn't the most fascinating way to spend a Saturday
afternoon. But it beats watching cable news."
~~ Booman
------------------------------
Date: Tue, 15 Apr 2008 05:24:55 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: modules for nntp client
Message-Id: <Xns9A81E64D7CECasu1cornelledu@127.0.0.1>
"Gerry Ford" <gerry@nowhere.ford> wrote in
news:1208234940_6@news.newsgroups.com:
>
> "Tad J McClellan" <tadmc@seesig.invalid> wrote in message
> news:slrng06hbt.pbt.tadmc@tadmc30.sbcglobal.net...
>> Gerry Ford <gerry@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
>
> This is the current contents of my Path system variable:
OK, but why are you listing it.
> C:\Program Files\perl3\site\bin;C:\Program
> Files\perl3\bin;c:\path\gcc\bin;C:\Program
> Files\Silverfrost\FTN95;C:\Perl\site\bin;C:\Perl\bin;c:\ruby\bin;
> %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem
>
> This is, BTW, something that AS perl users on windows need to go
> in and trim after installations.
I have never had to do that. Could you explain what needs to be
trimmed and why? The only thing I can see is that you seem to have
installed Perl twice. Once in a non-default subdirectory of
C:\Program Files.
You also have gcc there which might confuse CPAN.pm or command line
build tools.
> I was wondering why I can use perldoc from a dos window anywhere,
> and see that the answer is that the path leads to the binaries,
> wherein we see perldoc.bat. I wouldn't have believed for a second
> that this is how I get output with the perldoc command:
Again, why is that hard to believe.
>
> @rem = '--*-Perl-*--
> @echo off
> if "%OS%" == "Windows_NT" goto WinNT
> perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
> goto endofperl
>:WinNT
> perl -x -S %0 %*
perl --help
-x[directory] strip off text before #!perl line and perhaps cd
to directory
-S look for programfile using PATH environment variable
Did you have a question?
Sinan
--
A. Sinan Unur <1usa@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/
------------------------------
Date: Tue, 15 Apr 2008 01:09:09 -0500
From: "Gerry Ford" <gerry@nowhere.ford>
Subject: Re: modules for nntp client
Message-Id: <1208239309_8@news.newsgroups.com>
"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
news:Xns9A80CC6552B84asu1cornelledu@127.0.0.1...
> "Gerry Ford" <gerry@nowhere.ford> wrote in
> news:1208216001_0@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.
Thanks for your response. I'll need to shift gears from fortran, which is
case insensitive.
> 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/
I don't think it is. When I have a script with
use Win32::ANSIConsole qw/coninit cls/;
, perl.exe is looking for an absent ANSIConsole.pm that has coninit and cls
defined.
At the above link, I get this:
package Win32::Console::ANSI;
#
# Copyright (c) 2004 Jean-Louis Morel <jl_morel@bribes.org>
#
# Version 1.01 (08/06/2005)
#
# This program is free software; you can redistribute it and/or modify
# it under the same terms as Perl itself.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the
# GNU General Public License or the Artistic License for more details.
#
use 5.006;
use strict;
use warnings;
require Exporter;
our @ISA = qw(Exporter);
our $VERSION = '1.00';
our %EXPORT_TAGS = (
'all' => [ qw( Title Cursor XYMax SetConsoleSize Cls ScriptCP )],
);
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} },
);
our @EXPORT = qw(
);
package Win32::Console::ANSI;
require XSLoader;
XSLoader::load('Win32::Console::ANSI', $VERSION);
1;
__END__
# pod data elided for length
First of all, Cls is, by your criterion, different from cls, and there is no
coninit at all.
> 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
I looked at these, and they look like:
Common Gateway Interface Class Lincoln D. Stein (lstein@cshl.org) Automated
accessor generation Marty Pauley (marty+perl@kasei.com) Inheritable,
overridable class data Tony Bowden (tony@tmtm.com) class and object builder,
hash version GomoR (netpkt@gomor.org) Get information about a class and its
structure Adam Kennedy (adamk@cpan.org) Fast prototype-based OO programming
in Perl. Toby Ovod-Everett (toby@ovod-everett.org) Base class for creating
singleton objects Andy Wardley
This looks like it was expecting a program to read text, not a human ambling
about, trying to find a module.
> perl -MNet::NNTP -e "print qq{$Net::NNTP::VERSION\n}"
> will print the version installed (assuming it is installed).
2.24
>> 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
How do I replicate this process on windows? As it is, a file that ends in
tar.gz just creates huge problems for me.
>> 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.
> You can see at http://perldoc.perl.org/index-modules-N.html
> that both Net::NNTP and Net::SMTP are core modules.
Gotcha. This is necessary viewing for persons who are taking their first
steps with modules.
> However, do read the posting guidelines first.
Just to prove I was there for the sixth time:
Beware of saying ``doesn't work''
--
"Shopping for toilets isn't the most fascinating way to spend a Saturday
afternoon. But it beats watching cable news."
~~ Booman
------------------------------
Date: Tue, 15 Apr 2008 06:35:16 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: modules for nntp client
Message-Id: <Xns9A811A523EFEEasu1cornelledu@127.0.0.1>
"Gerry Ford" <gerry@nowhere.ford> wrote in
news:1208239309_8@news.newsgroups.com:
> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
> news:Xns9A80CC6552B84asu1cornelledu@127.0.0.1...
>> "Gerry Ford" <gerry@nowhere.ford> wrote in
>> news:1208216001_0@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.
...
>> 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/
>
> I don't think it is.
I think it is.
You snipped it but
http://backpan.perl.org/authors/id/J/JL/JLMOREL/
http://backpan.perl.org/authors/id/J/JL/JLMOREL/Win32-ANSIConsole-0.01.tar.gz
shows it to be.
> When I have a script with
> use Win32::ANSIConsole qw/coninit cls/;
> , perl.exe is looking for an absent ANSIConsole.pm that has
> coninit and cls defined.
...
> First of all, Cls is, by your criterion, different from cls, and
> there is no coninit at all.
The API might have changed between Win32::ANSIConsole and
Win32::Console::ANSI. Clearly, the module is available from the
backpan link. If it is a Pure Perl module, you can install it
by unpacking the archive and manually copying the files to
a custom directory and reading
perldoc lib
>> 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
>
> I looked at these, and they look like:
> Common Gateway Interface Class Lincoln D. Stein (lstein@cshl.org)
Those are repositories to add to ppm.
> This looks like it was expecting a program to read text, not a
> human ambling about, trying to find a module.
Exactly. Add the repositories to ppm.
>> perl -MNet::NNTP -e "print qq{$Net::NNTP::VERSION\n}"
>> will print the version installed (assuming it is installed).
> 2.24
>
>>> 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
> How do I replicate this process on windows? As it is, a file that
> ends in tar.gz just creates huge problems for me.
Use ppm.
If I understand correctly, right now you are trying to get a program
written by someone else to run on your system. Since clp.misc is not
a support group for random scripts found on the web, you should expect
to either do a considerable amount of work yourself or obtain support
from the author of the script.
After reading the source of the module
http://backpan.perl.org/authors/id/J/JL/JLMOREL/Win32-ANSIConsole-0.01.tar.gz
you can decide if consinit and cls are necessary and look for a way of
replacing that functionality if needed.
Or, as I mentioned above, you can manually unpack the module files
without relying on the automated process which ppm gives you for
modules found in current repositories.
Sinan
--
A. Sinan Unur <1usa@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/
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 1441
***************************************