[15828] in Perl-Users-Digest
Perl-Users Digest, Issue: 3241 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 3 09:05:45 2000
Date: Sat, 3 Jun 2000 06:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <960037511-v9-i3241@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sat, 3 Jun 2000 Volume: 9 Number: 3241
Today's topics:
BerkeleyDB Installation <aarond@ieighty.net>
Re: CHDIR - I can't get it to work <kenny@kenny.co.uk>
Re: CHDIR - I can't get it to work <kenny@kenny.co.uk>
compiling .pl with perlcc fails <tomtom72NOtoSPAM@yahoo.com.invalid>
Creating Dozens of Branch Processes wired2000@my-deja.com
debug perl script called by webserver eastking@my-deja.com
delete file in Perl <ltlau@yahoo.com>
Re: delete file in Perl <tony_curtis32@yahoo.com>
Re: delete file in Perl <bwalton@rochester.rr.com>
Re: delete file in Perl (Philip 'Yes, that's my address' Newton)
Re: Email this story to a friend - html to text <rlanier@nc.rr.com>
How do I update records in a file? (cgi & perl) <nayler@SPAMOFFses.curtin.edu.au>
Re: how do you create scalar vars from a hash? (Arne Hermann)
Re: how do you create scalar vars from a hash? (Arne Hermann)
Re: How to find out height and width of a PNG graphic <randeg@alum.rpi.edu>
Re: Interpreting Benchmark <bill@billcampbell.com>
Re: my Foo $self = shift; <abe@ztreet.demon.nl>
Re: Newbie needs help..... fenderstratocaster@my-deja.com
News::NNTPClient locdog@my-deja.com
perl Configure <wwx@chi.is.tw>
Re: Perl unusable as a programming language <kaleja@estarcion.com>
Re: Perl unusable as a programming language (David Combs)
PerlBall - Perl source code compressor lunaworks@my-deja.com
REQ: bytewise string manipulation C style instead of su <j.bessels@quicknet.nl>
Simple (to use) & secure encryption <clcollie@mindspring.com>
Re: Speed <bill@billcampbell.com>
Re: Using awk in perl? (Peter McMorran)
Re: Web-based email solutions (Steve Leibel)
Re: Web-based email solutions <apietro@my-deja.com>
Re: win32:MAPI Email and CGI - http://here.at/perl <ittso.3wing@videotron.ca>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 03 Jun 2000 02:15:50 GMT
From: Aaron D. <aarond@ieighty.net>
Subject: BerkeleyDB Installation
Message-Id: <8h9poe$m98$1@nnrp1.deja.com>
OK, I'm having a tough time with this and maybe somebody out there can
point me in the right direction. I'm trying to install BerkeleyDB for
Activestate Perl. Now usually I just copy the appropriate PM files and
dir structure to my site/lib folder and off I go. Occasionally, I have
to build the module on my Linux server and then move the built files
over. I can't seem to get anything to work this time. I've tried:
1) On my linux server I tried the whole "perl Makefile.PL" routine and
got an "undeclared variable" error while Make handled the XS file.
2) I tried to just copy the PM and XS files over straight, but of
course, Autoloader can't find the XS routines it needs.
3) I was finally able to compile the C++/Java part after digging out my
MSVC. But I'm not sure if those LIB files are in anyway necessary for
the Perl build.
I guess I'm just confused =) The documentation isn't terribly clear on
this. I greatly appreciate your time and patience with my ignorance =)
Cheers!
Aaron Dalton
<aarond@ieighty.net>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 3 Jun 2000 13:23:00 +0100
From: "Kenny" <kenny@kenny.co.uk>
Subject: Re: CHDIR - I can't get it to work
Message-Id: <8hatar$nfa$1@uranium.btinternet.com>
The reason I put in the line I did rather than a DIE statement was simply
because I was using the command for the first time in a test program,
therefore I just was mucking about. The directory name I used definitely
exists because it came back with the statement "It worked" and I checked the
directory exists as well. However, I don't see how permissions could be a
reason it would not work. What permission needs to be set?
Kenny.
Gwyn Judd <tjla@guvfybir.qlaqaf.bet> wrote in message
news:slrn8j3o3q.4jj.tjla@thislove.dyndns.org...
> I was shocked! How could Kenny <kenny@kenny.co.uk>
> say such a terrible thing:
> >I have an odd problem. I am trying to use the CHDIR command to change to
a
> >directory on my server. However, when I use the command
> >
> >chdir('/web/guide/maindirectory/') ? print ("It worked\n") : print ("It
did
> >not work.\n");
>
> Try this for better error reporting:
>
> chdir('/web/guide/maindirectory') or die "Couldn't change directory: $!";
> print "It worked!";
> @all = <*.*>;
> etc...
>
> This will give you a better idea of what went wrong.
>
> >I get the response "It worked", therefore indicating that the script has
> >successfully changed to that directory. However, the very next line is
> >
> >@all = <*.*>;
> >
> >and when I print it, it does not bring the stuff back from the
> >/web/guide/maindirectory/ directory, it gives me a list of the files from
> >the root.
> >
> >Anyone know if I am doing something wrong, or if I am expecting CHDIR to
do
> >something that it can't do?
>
> It doesn't look like you are doing anything wrong. Maybe you have a
> permissions problem or the wrong directory name.
>
> --
> Gwyn Judd (tjla@guvfybir.qlaqaf.bet)
> My return address is rot13'ed
> The shifts of Fortune test the reliability of friends.
> -- Marcus Tullius Cicero
------------------------------
Date: Sat, 3 Jun 2000 13:24:14 +0100
From: "Kenny" <kenny@kenny.co.uk>
Subject: Re: CHDIR - I can't get it to work
Message-Id: <8hatas$nfa$2@uranium.btinternet.com>
The e-mail address I quoted is certainly not correct, if I put in my real
e-mail address I would get thousands of SPAM mail. You're not trying to
tell me people actually put in their real addresses here, are you? If you
do, how do you stop the spam?
Kenny
3iron <3ironNO3iSPAM@bigfoot.com.invalid> wrote in message
news:0e757294.c9348e27@usw-ex0102-015.remarq.com...
> The email address you have provided in your post is wrong.
>
> If anyone wishes to reply to this post, please do so through the
> NG, not by email.
>
> Regards.
>
>
> * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network
*
> The fastest and easiest way to search and participate in Usenet - Free!
>
------------------------------
Date: Sat, 03 Jun 2000 03:16:59 -0700
From: Liz <tomtom72NOtoSPAM@yahoo.com.invalid>
Subject: compiling .pl with perlcc fails
Message-Id: <06994dae.367c465e@usw-ex0109-069.remarq.com>
Hello
I'm trying to conver
t a Perl script using Tk and XML::Parser to a standalone
executable for windows.
When I do
C:\>perlcc program.pl
it starts compiling, but at a certain point I get
Couldn't open !
and no .c file is created. Obviously I'm doing something
wrong. Does anyone have an answer? Thanks
Liz.
* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful
------------------------------
Date: Sat, 03 Jun 2000 08:03:48 GMT
From: wired2000@my-deja.com
Subject: Creating Dozens of Branch Processes
Message-Id: <8hae51$3uo$1@nnrp1.deja.com>
Hi,
I'm trying to make a script which will do massive WHOIS requests in
determining availability of domain names. Essentially, a web request
will occur and about 250 different word combinations will be made. I
would like to have a real-time script that will check all combinations
and return the output to a user within a few seconds. So, I'm wondering
if I could speed this up a bit by branching dozens of processes rather
than individual requests?
Does anybody have any ideas on how I can accomplish this or if you have
any better algorithm ideas, I welcome your opinions.
Thanks!
PS: Is there a faster way to determine if a domain is available apart
than WHOIS?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 03 Jun 2000 06:01:55 GMT
From: eastking@my-deja.com
Subject: debug perl script called by webserver
Message-Id: <8ha70e$uoc$1@nnrp1.deja.com>
I am developing CGI application under linux/Apache.Is there any one can
help me to debug perl script which was called by webserver. It means
that I called this perl script/CGI by web brower,how can I debug this
script.Thank in advance.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 3 Jun 2000 10:30:11 +0800
From: "JL" <ltlau@yahoo.com>
Subject: delete file in Perl
Message-Id: <39386d66@news02.imsbiz.com>
Hi,
Can anyone please help me?
How to write a perl program which can delete files in a directory. And I
only want to delete those files which is more than one day old(I mean the
last modify is more than 24hrs).
Thanks for your help.
------------------------------
Date: 02 Jun 2000 21:36:07 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: delete file in Perl
Message-Id: <87ln0nlcdk.fsf@limey.hpcc.uh.edu>
>> On Sat, 3 Jun 2000 10:30:11 +0800,
>> "JL" <ltlau@yahoo.com> said:
> Hi, Can anyone please help me? How to write a perl
> program which can delete files in a directory. And I
> only want to delete those files which is more than one
> day old(I mean the last modify is more than 24hrs).
perldoc -f unlink
perldoc File::Find
hth
t
--
"Trying is the first step towards failure"
Homer Simpson
------------------------------
Date: Sat, 03 Jun 2000 02:47:44 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: delete file in Perl
Message-Id: <393870D0.CFFD5C0B@rochester.rr.com>
JL wrote:
...
> How to write a perl program which can delete files in a directory. And I
> only want to delete those files which is more than one day old(I mean the
> last modify is more than 24hrs).
...
for(<*.*>){unlink if -M>1}
--
Bob Walton
------------------------------
Date: Sat, 03 Jun 2000 06:12:10 GMT
From: nospam.newton@gmx.li (Philip 'Yes, that's my address' Newton)
Subject: Re: delete file in Perl
Message-Id: <39389d2c.144795169@news.nikoma.de>
On Sat, 03 Jun 2000 02:47:44 GMT, Bob Walton <bwalton@rochester.rr.com>
wrote:
> for(<*.*>){unlink if -M>1}
Won't this fail for files that don't have dots in their name?
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Sat, 03 Jun 2000 03:08:42 GMT
From: "Tony Lanier" <rlanier@nc.rr.com>
Subject: Re: Email this story to a friend - html to text
Message-Id: <_E_Z4.27504$3z1.417464@typhoon.southeast.rr.com>
If you're on UNIX (any flavor, I suppose), you'd have to set your $PERL5LIB
environment variable to point to this new directory. If you're on Windows
(or whatever), I'm not sure, but I would think its probably similar to what
I just said. Hope this helps.
Tony
<rk27@my-deja.com> wrote in message news:8h93np$6j7$1@nnrp1.deja.com...
>
>
> But how do I installed these modules. I tried extracting the files and
> putting them in a HTML folder inside the lib folder but the perl
> program was unable to find the files.
>
> I am on an NT.
>
> Thanks,
>
> -rk
>
> In article <87itvsghyl.fsf@limey.hpcc.uh.edu>,
> Tony Curtis <tony_curtis32@yahoo.com> wrote:
> > >> On Fri, 02 Jun 2000 16:19:28 GMT,
> > >> rk27@my-deja.com said:
> >
> > > I would like to add a feature to my website where the
> > > clients can email a story to their friends. I want the
> > > email to be sent in *plain text*. I have already written
> > > the code to grab the contents of a website in html and
> > > email it but I would like to convert the html to plain
> > > text before I mail it.
> >
> > Try the HTML::Parser, HTML::TreeBuilder and
> > HTML::FormatText modules.
> >
> > hth
> > t
> > --
> > "Trying is the first step towards failure"
> > Homer Simpson
> >
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Sat, 3 Jun 2000 18:52:35 +0800
From: "Thaddeus" <nayler@SPAMOFFses.curtin.edu.au>
Subject: How do I update records in a file? (cgi & perl)
Message-Id: <8hao29$pv4$1@ftp.curtin.edu.au>
I have some data stored in a file in the following format:
1|2|person|description
2|8|person|description
3|25|person|description
4|0|person|description
...etc...
People need to be able to update the second field via cgi and see the
results.
I'm fine with opening, printing, appending, and overwriting records, but how
do I get to a certain part of a certain record and update that in
particular? Since this is web-based, different people can update the same
record at any one time - and I want all changes recorded.
How would I do this?
Thaddeus
------------------------------
Date: Sat, 03 Jun 2000 10:37:57 GMT
From: arneh@NOSPAMistar.ca (Arne Hermann)
Subject: Re: how do you create scalar vars from a hash?
Message-Id: <3938dd66.219171116@news.direct.ca>
On Thu, 1 Jun 2000 15:22:02 -0500, tadmc@metronet.com (Tad McClellan)
in a haze of confusion and insensitivity spewed forth the following:
>On Thu, 01 Jun 2000 02:28:00 GMT, Arne Hermann <arneh@NOSPAMistar.ca> wrote:
>>On Mon, 29 May 2000 17:22:31 -0700, Larry Rosler <lr@hpl.hp.com>
>>wrote:
>>>In article <3932c114.62322141@news.direct.ca>, arneh@NOSPAMistar.ca
>>>says...
>>>> this is not exactly a module question, but...
>>>
>>>You're right, so why mispost it?
>>
>>Cause I posted it several times elsewhere, without any luck!
>
>Perhaps you should have a look at Why Questions Go Unanswered:
>
> http://www.plover.com/~mjd/perl/Questions.html
>
>so that you can increase your chances the next time.
>
>>Sorry,
>>but sometimes one has to bend the rules (flame shields UP!).
> ^^^^^^^^^^^^^^
>You did not "bend" the rules.
>You "broke" the rules (and you knew you were).
>
>Flames should be only a minor concern, as they don't last long.
>
>What _should_ concern you is hurting your chances of getting
>_future_ Perl questions answered.
>
>Knowingly making off-topic postings is a Very Good Way of
>getting killfiled...
>
>--
> Tad McClellan SGML Consulting
Tad:
Your response is hardly in the spirit of Usenet. Your response was
basically a waste of peoples' time (as is this, but you asked for it).
I'm not some stupid news newbie - what I did was post *marginally off
topic* - I commited no sin. My original post was not that far off the
topic for .modules considering some of the garbage that gets posted
there. And, for what it's worth, it was not a stupid question, but
rather one that seems to have sparked an intersting thread beyond your
silly bitching. If there's one thing I hate, it's self-righteous
prigs like you coming down on others for sincerely trying to just get
something done. Give us all a break, man. LIGHTEN UP. When you get
a Usenet Police badge, come on back and enlighten the rest of us.
Jeez!
-Arne
P.S since you contributed nothing to the discussion (as opposed to
Larry), nor anyting else I've ever posted, you can put me in yer
killfile and I really won't lose any sleep over it.
------------------------------
Date: Sat, 03 Jun 2000 10:55:12 GMT
From: arneh@NOSPAMistar.ca (Arne Hermann)
Subject: Re: how do you create scalar vars from a hash?
Message-Id: <3938e041.219902346@news.direct.ca>
On Wed, 31 May 2000 22:45:25 -0700, Larry Rosler <lr@hpl.hp.com>
wrote:
>In article <3935beb4.14673748@news.direct.ca>, arneh@NOSPAMistar.ca
>says...
>...
>> On Mon, 29 May 2000 17:22:31 -0700, Larry Rosler <lr@hpl.hp.com>
>> wrote:
>...
>> >In article <3932c114.62322141@news.direct.ca>, arneh@NOSPAMistar.ca
>> >says...
>...
>> >> I have an associative array (lets say it's %PARMS). I know in advance
>> >> that there will be certain keys in this hash. What I want to do is
>> >> assign the values to a scalar variable with the name of the hash key.
>> >> This is easy in PHP but I can't quite figure out how to do it in Perl.
>> >>
>> >> So let's say it looks like:
>> >>
>> >> $PARMS{'ParamOne'} = 'FOO';
>> >> $PARMS{'ParamTwo'} = 'BAR';
>> >>
>> >> What can I do (aside from the obvious simple assignment!) to be able
>> >> to simply access $ParamOne? In this case I have a lot of variables
>> >> that get passed back and forth between things and I don't want to
>> >> create a huge simple scalar assignment block... I would like to just
>> >> iterate over all the keys in $PARMS and create their "scalar
>> >> equivelent". There's gotta be a 'trick' right?
>> >>
>> >> Can anyone tell me how?
>> >
>> >Yes, I can tell you how:
>> >
>> > $$_ = $PARMS{$_} for keys %PARMS;
>>
>> Doesn't this imply that one could, in a simpler situation say:
>> (I'll tackle why I want to do this later herein...)
>>
>> $$PARMS{'foo'} = $PARMS{'foo'};
>>
>> ?? When I tried this (as a test, not looping over the hash) it didn't
>> work (hence the original post)! The code was like this:
>>
>> $PARMS{'foo'} = "FOO";
>> $$PARMS{'foo'} = $PARMS{'foo'};
>
> $PARMS{'foo'} = "foo";
> ${$PARMS{'foo'}} = $PARMS{'foo'};
>
>You can leave out all those single quotes, and use single quotes for the
>simple constant:
>
> $PARMS{foo} = 'foo';
> ${$PARMS{foo}} = $PARMS{foo};
>
>> print "foo is $foo\n"; #does not print FOO, prints null
>> $$_ = $PARMS{$_} for keys %PARMS;
>> print "foo is $foo\n"; #prints FOO
>> exit;
>
>...
>> Thanks for the help though. Be interested in hearing if you think
>> that what I'm doing still really violates the spirit of using the
>> 'strict pragma'.
>
>Yes, it really violates the spirit of using the 'strict' pragma. But
>that's OK, because you can use 'use strict;' in most of the program and
>use 'no strict;' in a limited scope, and the 'strict' police won't come
>after you.
>
>> And, of course, your thoughts on why the $$PARMS
>> assignment doesn't work!
>
>I answered that above. It is a question of binding precedence, and Perl
>variable names are case sensitive. $FOO isn't the same as $foo.
Um, I know that var names are case sensitive (duh!) - I never
referenced $FOO anywhere but only $foo (where did you see $FOO??) .
And you didn't really anwer the question - the question was, why does
the assignment I tried not work? Why does one have to use
${ $PARMS{foo}} = ... but $$_ works in your example?? I would have
thought (incorrectly, obviously) that $$PARMS{foo} = ... would have
worked.
Oh, and BTW, saying $PARMS{foo}='FOO' and $PARMS{'foo'} = "FOO" are
essentially equivelent and to say mine is wrong just seems like
needless quibling.
And in this particular case (ie my config file example) I think that
most would agree that this "violation" of the strict pragma is ok;
these things are never absolutes and it seems to me that -
philosophically anyway - in this case this var re-assignment is
acceptable under the circumstances.
-Arne
------------------------------
Date: Sat, 03 Jun 2000 12:37:21 GMT
From: Glenn Randers-Pehrson <randeg@alum.rpi.edu>
Subject: Re: How to find out height and width of a PNG graphic
Message-Id: <8hau60$dln$1@nnrp1.deja.com>
In article <3937a74c$0$83464@SSP1NO17.highway.telekom.at>,
"Mösl Roland" <founder@pege.org> wrote:
> I am far far away from being perfect in Perl,
> but I am using Perl as my standard programing
> language now.
>
> I extracted from other scripts how to find out
> height and width of a GIF or a JPG graphic,
> but I did not find it until now for a PNG.
>
> But I want to change all my sites to PNG
> because of this idiotic patent threat with GIF
Good plan!
If you cannot find a ready-made PERL script to find the PNG
width and height, you can write one that extracts the width
from bytes 17-20 (offset 16 from beginning of file) and
the height from bytes 21-24 (offset 20). They are 4-byte
unsigned integers in network byte order, so (in C language,
assuming you have read the first 24 characters into c0 through
c23)
width=(c16<<24)|(c17<<16)|(c18<<8)|c19;
height=(c20<<24)|(c21<<16)|(c22<<8)|c23;
c0 through c7 are the PNG signature bytes (it is a good idea to
check them in case the file has been corrupted by a bad FTP transfer
or something), and c8-c15 are the header chunk length (0,0,0,decimal 13)
and type ("IHDR").
See the PNG spec, which you can find somewhere at
http://www.libpng.org/pub/png/
--
Glenn Randers-Pehrson
PNG/MNG Development Group
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 03 Jun 2000 04:02:48 GMT
From: "Bill" <bill@billcampbell.com>
Subject: Re: Interpreting Benchmark
Message-Id: <Ir%Z4.147134$55.3050158@news2.rdc1.on.home.com>
>The clock on my wall (and the Perl "wallclock" function time()) ticks
>once a second. As such if I use it to time the duration of something
>it can be almost a second out in either direction.
>
>Start: 17:52:30.000
>End: 17:52:31.999
>
>Wallclock seconds elapsed 1, actual seconds elapsed 1.999
>
>Start: 17:52:32.999
>End: 17:52:33.000
>
>Wallclock seconds elapsed 2, actual seconds elapsed 1.001
er, pardon me, this may be off topic but I couldn't quite lurk past this without
noticing the math on your second elapsed time. shouldn't that be 0.001 ?
------------------------------
Date: Sat, 03 Jun 2000 03:23:45 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: my Foo $self = shift;
Message-Id: <6tkgjsok366pgpojir3r5p8h21m0n8bi6c@4ax.com>
On 02 Jun 2000 20:32:00 +0200, kaih=7f5KDBiHw-B@khms.westfalen.de (Kai
Henningsen) wrote:
> abe@ztreet.demon.nl (Abe Timmerman) wrote on 02.06.00 in <3bdfjsgvbhvaien31r6t2b7k9u8g94vmp4@4ax.com>:
>
> > On 02 Jun 2000 14:22:00 +0200, kaih=7f50wpZmw-B@khms.westfalen.de (Kai
> > Henningsen) wrote:
> >
> > > kaih@khms.westfalen.de (Kai Henningsen) wrote on 02.06.00 in
> > > <7f4wXLC1w-B@khms.westfalen.de>:
> > >
...
> > DESCRIPTION
> > The `fields' pragma enables compile-time verified class fields.
> > .... (see Sam's post)
>
> I've seen it. In fact, seeing that particular man page prompted my first
> post.
>
> From which you can deduce that I don't think what's there is even halfway
> reasonable documentation. Not even remotely up to the usual Perl
> documentation standards.
I agree that it's not one the best pages in the docs.
>
> > - every instance of the class should be a typed lexical:
> > my Foo $obj = Foo->constructor();
>
> Define "typed lexical".
(Not my strongest point), but something along the lines of:
A lexical that is associated with a class on compile-time.
> What is legal in that place in the my construct?
Define 'legal'. Something that doesn't generate a compile-time error?
perl expects a known (at compile-time) class there.
> And what, precisely, does Perl do when something is there?
Like the man page says, it checks to see if the package holding the
class with that name uses the fields pragma.
If so, class field checks are done at compile-time for that lexical
associated with typed class.
--
Good luck,
Abe
------------------------------
Date: Sat, 03 Jun 2000 02:33:20 GMT
From: fenderstratocaster@my-deja.com
Subject: Re: Newbie needs help.....
Message-Id: <8h9qpg$mpq$1@nnrp1.deja.com>
I tried "perl hello.pl" and it worked. Thanks for your help.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 03 Jun 2000 02:57:37 GMT
From: locdog@my-deja.com
Subject: News::NNTPClient
Message-Id: <8h9s6s$nrk$1@nnrp1.deja.com>
All,
I have visited the News::NNTPClient site and I believe that
I must be doing something wrong. I am trying to use authorization
to pull newsgroups from a newsserver. Located on the page there
is an authinfo area that says it looks for username and pass.
When I use my local news server the script works fine without
password authentication, the only problem I have is with the
authinfo part of the script.
http://ltpwww.gsfc.nasa.gov/ltpcf/about/unix/Depotdoc/NNTPClient/NNTPCli
ent.pm.html
Here is the error I get with the script below:
NNTPERROR: 502 NEWNEWS Permission Denied (command disabled)
$newsserver, $days etc., are defined earlier in the script just
so that you are aware.
My question is...Am I doing the authinfo right? The server, username,
and pass work fine when I use a normal news reader program.
Thanks,
LoC
########## BEGIN SCRIPT #############
require News::NNTPClient;
$c = new News::NNTPClient($newsserver);
$x = 0;
$c->authinfo("username", "password"); ## Problem area
foreach ($c->newnews($forum, time - $days)) {
open(OUTFILE, ">$x.txt");
print OUTFILE $c->body($_);
close(OUTFILE);
$x = $x + 1;
}
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 3 Jun 2000 20:29:13 +0800
From: "www.hinet.net" <wwx@chi.is.tw>
Subject: perl Configure
Message-Id: <8hatqt$btc@netnews.hinet.net>
I want to install SSLeay on my Apache server..But I am not familiar with
perl
I have a problem..
I install SSleay by the step following..
''''''''''''''''''''''''''''''''''''''''''''''''''''''''
cp SSLeay*.tar /usr/local
tar xvf SSLeay*.tar
cd /usr/local/SSLeay*
perl Configure linux-elf
..
.....
...
''''''''''''''''''''''''''''''''''''''''''''''''''''''
The system tells me [ Can't open Perl Script "Configure" No such file
ordirectory" ]
Would anybody tell me what happened??
Thanks
------------------------------
Date: Fri, 02 Jun 2000 14:50:07 -0700
From: Russell Bornschlegel <kaleja@estarcion.com>
Subject: Re: Perl unusable as a programming language
Message-Id: <39382C0F.ABD8E69@estarcion.com>
Ilya Zakharevich wrote:
>
> [A complimentary Cc of this posting was sent to Russell Bornschlegel
> <kaleja@estarcion.com>],
> who wrote in article <3937F12D.E1B7C255@estarcion.com>:
> > Ah, I see. I've never programmed, then, nor been in a situation where the
> > documentation was sufficient to allow programming.
>
> I suspect a lot of people are in the same situation as you are. Not
> many people being their carrier with writing a C compiler starting
> from the standard... ;-)
Still insufficient unless the compiler is for a standalone (embedded/no
OS) implementation.
> I think the Knuth's books are a must in such situations as yours...
How so? So that I can change my situation to one in which programming[1]
is possible, or so that I can cope with the situation in which programming[1]
is impossible?
-RB
[1] That is, programming according to the definition we're playing with
now.
------------------------------
Date: 2 Jun 2000 21:19:18 GMT
From: dkcombs@netcom.com (David Combs)
Subject: Re: Perl unusable as a programming language
Message-Id: <8h98cm$r4d$1@slb2.atl.mindspring.net>
In article <cjFZ4.99988$hT2.406636@news1.rdc1.ct.home.com>,
Dan Sugalski <dan@tuatha.sidhe.org> wrote:
>In comp.lang.perl.misc Malcolm Dew-Jones <yf110@victoria.tc.ca> wrote:
>> Dan Sugalski (dan@tuatha.sidhe.org) wrote:
>> : In comp.lang.perl.misc Malcolm Dew-Jones <yf110@victoria.tc.ca> wrote:
>
>> : > That might be either a bug or a misunderstanding on my part.
>
>> : Misunderstanding. Which is understandable, since it's both kinda odd and
>> : undocumented.
>
>> Nice example, thanks.
>
>> Threads such as this as good for learning things. I have been forced to
>> clarify my understanding of local.
>
>Don't use this as a way to understand local. What we're talking about here
>actually has nothing to do with local, and everything to do with where
>match variables live in perl's space.
>
>Package variables, the things you can local()ize, live in the symbol table
>and are persistent--their values stick until you change them. If you
>localize them, the change sticks until the local goes out of scope. When a
>block exits, perl cleans up things that should be cleaned up when a block
>goes away.
>
Not that I program in lisp -- I don't -- but I do read
ABOUT lisp.
Seems to me that these days (maybe not at perl0) the
concepts and vocabulary of lisp (lisp today AND lisp of old)
could be well used in discussions of and documentation of PERL.
Like this "local" word. (idea: maybe "localized" is less
ambiguous, the way it has been used thus far in perl discussions).
Lisp-of-old (and still emacs-lisp) uses what's called (in the lisp
world) "dynamic binding".
And there's (at least?) TWO ways of implementing it: "deep"
and "shallow" (at least those are the terms that I recall
from the classic "anatomy of
lisp" book by Allen, 1975 or so?, probably still available)
Anyway, it seems to ME that that's PART of what "local" does
(maybe it's identical?)
Likewise from lisp (er, scheme) is "lexical binding", which
the "new" lisp, "common lisp" uses as default (though retaining
for those special times the dynamic-binding, via variables
referred to (tagged-as?) "special variables" -- for
same reasons people still use "local" in perl for certain
situations -- the SAME situations, usually).
---
Another useful (VERY useful) term (and CONCEPT!) is a word
used up above: "binding".
About a VALUE being (for now) "BOUND" to a NAME.
Seems to me that if the doc included these things, it
would help clarify things.
ALSO, and not to be sneezed at, it enables perl people
to read books on OTHER languages (eg lisp) and ALREADY
understand the terminology.
---
Suggestion: the word "local" should be made a SYNONYM for
"dynamic" or "dynamically-bound" or "special" or some such,
and that NEW (actually, old) term be used in NEW doc.
No sense in inventing new language, eg local, especially
when it has such a different meaning from in other languages!
And is such a source of confusion!
---
Anyway, lisp has so much history, so much vocabulary, so
many concepts, so many problems already met and solved
or worked around and language developed for, it seems
a pity to not use that SAME language for those concepts
in perl that match -- and there are many, more and more
all the time.
Would enable a perl user to talk to a lisp user.
David
------------------------------
Date: Sat, 03 Jun 2000 12:31:52 GMT
From: lunaworks@my-deja.com
Subject: PerlBall - Perl source code compressor
Message-Id: <8hatro$dc7$1@nnrp1.deja.com>
PerlBall is a free utility that strips
your Perl scripts' source code of variable
names, subroutine names, comments,
formatting, etc., making it much smaller
(usually about 50%, but up to 15%), faster
to load and harder (mind the comparative)
to crack.
PerlBall is available for free download under:
http://members.tripod.de/perlball/
have fun!
Henning
--
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 03 Jun 2000 14:59:59 +0200
From: Jan Bessels <j.bessels@quicknet.nl>
Subject: REQ: bytewise string manipulation C style instead of substr
Message-Id: <3939014F.CFC3C92C@quicknet.nl>
I want to make a ROTT13 implementaton. Letter a replaced by n, b
replaced by o etc. Executing two rott13's on a string gives the
original one back. Basically I take a string and manipulate it on char a
time. I can do this by using substr to extract a single char Somehow
I'll think this to much of an overhead. I would like to do it the -c
language way, directly manipulating the memory addresses where the
string resides. I'm currently at home, without perl books. Anyone any
pointer to info how to do this, maybe even examples
An cc to tux@planet.nl is also much appreciated.
Jan Bessels
------------------------------
Date: Fri, 2 Jun 2000 22:39:17 -0400
From: "clayton collie" <clcollie@mindspring.com>
Subject: Simple (to use) & secure encryption
Message-Id: <8h9qr1$egl$1@nntp9.atl.mindspring.net>
im involved in an educational project which requires sending student data
over the net to be stored in a DB at an ISP. they allow no CGI scripting
except Perl & ASP (ChiliSoft). i therefore need some code to use at the
server end to base64 decode (easy) and decrypt data sent by a form on the
client side. my limitation is at the Perl side - i can match whatever Perl
encryption algorithm i find with appropriate code on the client side .
clayton
------------------------------
Date: Sat, 03 Jun 2000 04:10:06 GMT
From: "Bill" <bill@billcampbell.com>
Subject: Re: Speed
Message-Id: <yy%Z4.147215$55.3051072@news2.rdc1.on.home.com>
I hope the original poster will post a brief note when he is done. I'd be
interested in knowing how much he was able to reduce the 2.5 hours.
Bart Lateur wrote in message <393910e1.16089180@news.skynet.be>...
>newbie@db-networks.com wrote:
>
>>How can I speed it up? Help will be appreciated.
>
------------------------------
Date: Sat, 03 Jun 2000 02:28:17 GMT
From: mcmorran@visi.net (Peter McMorran)
Subject: Re: Using awk in perl?
Message-Id: <39386d3c$2$zpzbeena$mr2ice@news.visi.net>
In <959966269.915647@thrush.omix.com>, on 06/02/00
at 05:14 PM, zenin@bawdycaste.org said:
>A Pietro <apietro@my-deja.com> wrote:
>: Thanks for your reply. I'll check a2p out...
>:
>:>You can use a2p to convert your awk stuff into slightly less than idiomatic
>: Perl.<
>:
>: It wasn't what I was thinking of, exactly. I was thinking of temporarily
>: running awk from the shell -- might this be faster than doing awk stuff in
>: Perl?
> Actually, it wouldn't. You're fork()ing an external process to
>do
> something that Perl is just as much...if not more optimized to
> handle.
> There is slim to no reason to call sed or awk from perl, ever.
Yes, and Perl does awk stuff lightning fast. Try it, you'll like
it. I've a bunch of csh/awk/bc scripts, and some newer ones in
Perl. If I had the time, I'd rewrite them all in Perl. The beauty
of Perl is that you can stay in the same process, saving the
fork/exec time for the subprocesses. And, did I say it runs
lightning fast ;-)
Cheers,
Peter
--
-----------------------------------------------------------
mcmorran@visi.net (Peter McMorran)
-----------------------------------------------------------
------------------------------
Date: Fri, 02 Jun 2000 23:25:58 -0700
From: stevel@coastside.net (Steve Leibel)
Subject: Re: Web-based email solutions
Message-Id: <stevel-0206002325580001@192.168.100.2>
In article <8h7oh4$567$1@sshuraac-i-1.production.compuserve.com>, "A
Pietro" <apietro@my-deja.com> wrote:
> My company is thinking of setting up a web-based email system (similar to
> Hotmail,Yahoo etc.). How can we start to build such a system (using Linux)?
>
I'd start by reading every email-related RFC, probably a couple of times.
Then I'd get a bunch of people in a room with a whiteboard, trays of
sandwiches, lot of coffee, softdrinks, and water. At the end of the day
they'd have a preliminary design.
Then I'd delegate a Perl programmer to go off and build a working
prototype of the design. I'd delegate someone else to look into
performance and scaleability issues. Someone else would be in charge of
giving seriously more thought to the design. Someone else would be in
charge of coming up with a test plan. The group would be responsible
individually and collectively for meeting deadlines and deliverables.
Perl comes into play as an ideal design prototyping language. It's
flexible, it's quick, it's object-oriented without requiring you to spend
six months in design before you write any code. By the time you have your
1.0 system you'll be beginning to understand the nature of the problem,
and you'll be ideally positioned to build the system you really want.
> * Is it simply a case of setting up a new user account for everybody that
> subscribes? Then, the mail is sent to /home/username/mail?
Sure, that's all there is to creating a system like Hotmail. Not.
> * Any special sendmail.conf required?
Code your own mailserver if you like. Or hack sendmail. Or whatever. It
depends on your design.
> * Any web resources/code out there. Maybe we could do it using Perl?
You can do it in FORTRAN if you like. Have you thought about a design?
Steve L
------------------------------
Date: Sat, 3 Jun 2000 09:33:37 +0100
From: "A Pietro" <apietro@my-deja.com>
Subject: Re: Web-based email solutions
Message-Id: <8haftg$qbl$1@sshuraaa-i-1.production.compuserve.com>
Thanks Steve,
I've decided to go with Perl.
Although some people say PHP is faster for HTML pages...do you know if this
is true?
AP
------------------------------
Date: Fri, 2 Jun 2000 21:51:31 -0400
From: "J::Lambert" <ittso.3wing@videotron.ca>
Subject: Re: win32:MAPI Email and CGI - http://here.at/perl
Message-Id: <BwZZ4.2925$rr.63183@weber.videotron.net>
Thanks for your advice.
It is in fact the case, the script runs under windows command prompt using
the >perl namefile.pl command, but not through my web server (in this case
IIS 5) into a CGI.
All other CGI work fine, but not this one. Also, once run, my MAPI default
apps fail to run again (like Outlook express).
Using Win32:OLE, I came up with this :
# Send Email using Outlook session
# J. Lambert - 1 juin 2000
print "Content-type:text/html\n\n";
# use strict;
use Win32::OLE qw(in with);
use Win32::OLE::Const 'Microsoft Outlook';
$Win32::OLE::Warn = 3; # die on errors...
my $objOutlook = Win32::OLE->GetActiveObject('Outlook.Application') ||
Win32::OLE->new('Outlook.Application', 'Quit');
my $objOutlookMsg = $objOutlook->CreateItem(olMailItem);
$objOutlookMsg->{'Subject'} = "Hello";
$objOutlookMsg->{'Body'} = "Bonjour a toute la famille";
$objOutlookMsg->Display();
$objOutlookMsg = "";
print "<h1>Mail sent</h1>";
exit;
Doesn't work with IIS. I'll play around with script permissions, mem
allocation and suchs.
Thanks,
J.Lambert
http://here.at/perl
"Jonathan Stowe" <gellyfish@gellyfish.com> wrote in message
news:8h7luo$sv1$1@orpheus.gellyfish.com...
> In comp.lang.perl.misc J::Lambert <ittso.3wing@videotron.ca> wrote:
> > Does anyone found a way to send an Email using the MAPI layer of a win32
OS
> > (through Outlook 97) from a perl / cgi script ?
> >
> > I have tried win32:MAPI - works only in cmd prompt mode.
>
> I'm not sure what you mean by 'works only in cmd prompt mode'. If
> you mean that it doesnt work when you use it in a CGI program then what
> you have is a server configuration issue and you will want to ask in
> some Windows group about configuring your system so that the appropriate
> user can use the resources required.
>
> You might also look at the module Win32::OLE - there is an example of
> using this to control a MAPI object in the ActiveState documentation.
>
> > I've tried Mail:Sender - works only with SMTP, doesn't use MAPI
> >
> > Our mail server is Exchange and it doesn't suppport internet mail (SMTP
or
> > POP)
> >
>
> Of course Exchange can be made to support these things - but you would
> have to ask in the appropriate group about this.
>
> /J\
> --
> Black, marbelized with a liquid center. The Stealth Bowler. The pins
> don't know what hit 'em.
> --
> fortune oscar homer
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 3241
**************************************