[18369] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 537 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 20 18:11:05 2001

Date: Tue, 20 Mar 2001 15:10:24 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <985129824-v10-i537@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 20 Mar 2001     Volume: 10 Number: 537

Today's topics:
        STDERR redirect to system log? (Todd H.)
    Re: STDERR redirect to system log? <krahnj@acm.org>
    Re: STDERR redirect to system log? <cernava@itexas.net>
    Re: substitution for /^[\w\.]\w*/ (Randal L. Schwartz)
    Re: substitution for /^[\w\.]\w*/ <tltabor@earthlink.net>
    Re: substitution for /^[\w\.]\w*/ (Randal L. Schwartz)
    Re: substitution for /^[\w\.]\w*/ <tltabor@earthlink.net>
    Re: substitution for /^[\w\.]\w*/ <elijah@workspot.net>
    Re: substitution for /^[\w\.]\w*/ <tltabor@earthlink.net>
    Re: substitution for /^[\w\.]\w*/ <elijah@workspot.net>
    Re: substitution for /^[\w\.]\w*/ <mjcarman@home.com>
        substitution/pattern matching -- setting the position.. (J.B. Moreno)
    Re: substitution/pattern matching -- setting the positi <krahnj@acm.org>
    Re: use Net::SMTP <webmaster@webdragon.munge.net>
        user module install under Solaris 8 (Matthew L. Langford)
    Re: Very new to Perl - desperate for help! <mjcarman@home.com>
        was -  way to check a pop3 mailbox without using additi <paulthomson@hotmail.com>
        WAS: check a pop3 mailbox without using additional modu <paulthomson@hotmail.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 20 Mar 2001 13:16:17 -0600
From: comphelp@toddh.net (Todd H.)
Subject: STDERR redirect to system log?
Message-Id: <lyr8zsjloe.fsf@k2.onsight.com>


I'm writing a script for AIX that traps various error conditions and
prints to STDERR.  Is there a way I can globally redirect STDERR to
the system log?

Is logger the way to go, or is there another interface in Perl to
write syslog messages? 


The syntax of the logger command is:

logger Command

Purpose

Makes entries in the system log.

Syntax

logger [ -f File ] [ -i ] [ -p Priority ] [ -t Tag ] [ Message ]

Description

The logger command provides an interface to the syslog subroutine,
which writes entries to the system log. A Message variable can be
specified on the command line, which is logged immediately, or a File
variable is read and each line of the File variable is logged. If you
specify no flags or variables, the logger command will wait for you to
enter a message from standard input.



-- 
Todd H.
http://www.toddh.net/


------------------------------

Date: Tue, 20 Mar 2001 20:24:24 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: STDERR redirect to system log?
Message-Id: <3AB7BE15.601069C1@acm.org>

"Todd H." wrote:
> 
> I'm writing a script for AIX that traps various error conditions and
> prints to STDERR.  Is there a way I can globally redirect STDERR to
> the system log?

About midway through the open function documentation is an example of
redirecting STDERR and STDOUT.
perldoc -f open


John
-- 
use Perl;
program
fulfillment


------------------------------

Date: Tue, 20 Mar 2001 14:57:26 -0600
From: "Itexas" <cernava@itexas.net>
Subject: Re: STDERR redirect to system log?
Message-Id: <998g8h010ar@enews4.newsguy.com>

As I remember its like this.
open(STDERR, ">Error.file") || die("could not open error file: $!");



"John W. Krahn" <krahnj@acm.org> wrote in message
news:3AB7BE15.601069C1@acm.org...
> "Todd H." wrote:
> >
> > I'm writing a script for AIX that traps various error conditions and
> > prints to STDERR.  Is there a way I can globally redirect STDERR to
> > the system log?
>
> About midway through the open function documentation is an example of
> redirecting STDERR and STDOUT.
> perldoc -f open
>
>
> John
> --
> use Perl;
> program
> fulfillment




------------------------------

Date: 20 Mar 2001 11:06:36 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: substitution for /^[\w\.]\w*/
Message-Id: <m18zm0qmyr.fsf@halfdome.holdit.com>

>>>>> "Tim" == Tim Tabor <tltabor@earthlink.net> writes:

Tim> Can y'all help me with s/// ?
Tim> I need to conform any string to this regex:
Tim>      /^[\w\.]\w*/

Tim> by removing 'illegal' characters.

Beware... I just found out in email that

        THIS WAS FOR JAVASCRIPT, NOT PERL

Boy, am I angry I wasted that much time on this creep.

Killfiles, activate.  He shall get no Perl help from me again.

Sheesh.  The nerve of this person.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


------------------------------

Date: Tue, 20 Mar 2001 19:19:18 GMT
From: "Tim Tabor" <tltabor@earthlink.net>
Subject: Re: substitution for /^[\w\.]\w*/
Message-Id: <W2Ot6.13688$Im6.1441915@newsread1.prod.itd.earthlink.net>

That's really, really, really unfair.

The question was about Perl, and my responsibility was to
implement the solution in JScript.  Which is why I
specifically asked for a 's//' solution.

I answer maybe ten newsgroup posts a day, and I've never
had a problem with someone asking how something is done in
one language to facilitate their doing it in another language.
And I've seen a netiquette list suggesting such a question is
inappropriate.

If you feel otherwise, my apologies.  And please, watch
your language.

Respectfully,

// timtabor

"Greg Bacon" <gbacon@HiWAAY.net> wrote in message
news:tbf9t8abkadh4b@corp.supernews.com...
> In article <WiNt6.13520$Im6.1435861@newsread1.prod.itd.earthlink.net>,
>     Tim Tabor <tltabor@earthlink.net> wrote:
>
> : Can y'all help me with s/// ?
> :
> : I need to conform any string to this regex:
> :      /^[\w\.]\w*/
> :
> : by removing 'illegal' characters.
>
>     #! /usr/local/bin/perl -w
>
>     use strict;
>
>     $_ = '99999.fo..o.b.ar';
>
>     s/^[^\w.]+//;
>     1 while s/^(.)(\w*)\W+(\w*)/$1$2$3/;
>
>     print "\$_ = '$_'\n";
>
> Hope this helps,
> Greg
> --
> VMS is a text-only adventure game. If you win you can use Unix.
>     -- Bill Davidsen




------------------------------

Date: 20 Mar 2001 11:28:10 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: substitution for /^[\w\.]\w*/
Message-Id: <m1n1agp7ed.fsf@halfdome.holdit.com>

>>>>> "Tim" == Tim Tabor <tltabor@earthlink.net> writes:

Tim> That's really, really, really unfair.

And on top of that... THIS POSTING WAS STEALTH-CC'ed.

A pox on Tim.

Bad bad bad usenet practices.  Sheesh.

Tim, I take back what I just said in email to you.  No amount of
apologizing today can get you out of my doghouse.  You wasted 15
minutes of my time (now 30, counting these responses) by not fully
disclosing your problem.  You then still don't get it about why that
was bad.  People like you are enough to drive away anyone with sense
from this group.

Just another guy who has been around Usenet since 1980,

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


------------------------------

Date: Tue, 20 Mar 2001 19:40:23 GMT
From: "Tim Tabor" <tltabor@earthlink.net>
Subject: Re: substitution for /^[\w\.]\w*/
Message-Id: <HmOt6.13731$Im6.1449317@newsread1.prod.itd.earthlink.net>

Randall, this really matters to me.  I'm just a
guy who helps others on the lists every day, and
occasionally asks for a little assistance myself.

1.  I mistyped.  I've _never_ seen any suggestion on
any netiquette list that this sort of question is
inappropriate.

2.  Nothing was stealth-cc'ed.  I use Outlook, and I
replied to the group and included you in the cc field.
Apparrently you see the newsgroup posts faster than me,
so I can't tell whether you're replying just to me or
as a cc to the list.  I saw your first message on the
list long after I received it direclty from you.  In future,
I won't cc you.

3.  I didn't have a hidden agenda.  I know JScript quite
well and enough Perl to translate a regular expression.
Why should the list be bothered with the JScript part,
since it's OT?  I merely mentioned it in my thank-you
note to you, and didn't ask for any further assistance.

5.  I've asked this on the Javascript lists, and no one
has proposed an elegant solution.  Since Perl is famous
for regex wizards (such as yourself, I'm sure), I thought
I'd give it a shot.

4.  There's no Perl + JScript newsgroup that I'm aware
of.

5.  You've helped me a lot, and I hope that you won't
be too angry that the ultimate implementation will be
a translation of your suggestion.

// tim

"Randal L. Schwartz" <merlyn@stonehenge.com> wrote in message
news:m1n1agp7ed.fsf@halfdome.holdit.com...
> >>>>> "Tim" == Tim Tabor <tltabor@earthlink.net> writes:
>
> Tim> That's really, really, really unfair.
>
> And on top of that... THIS POSTING WAS STEALTH-CC'ed.
>
> A pox on Tim.
>
> Bad bad bad usenet practices.  Sheesh.
>
> Tim, I take back what I just said in email to you.  No amount of
> apologizing today can get you out of my doghouse.  You wasted 15
> minutes of my time (now 30, counting these responses) by not fully
> disclosing your problem.  You then still don't get it about why that
> was bad.  People like you are enough to drive away anyone with sense
> from this group.
>
> Just another guy who has been around Usenet since 1980,
>
> --
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777
0095
> <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
training!
>




------------------------------

Date: 20 Mar 2001 20:04:30 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: substitution for /^[\w\.]\w*/
Message-Id: <eli$0103201449@qz.little-neck.ny.us>

In comp.lang.perl.misc, Tim Tabor <tltabor@earthlink.net> wrote:
> Randall, this really matters to me.  I'm just a
> guy who helps others on the lists every day, and
> occasionally asks for a little assistance myself.

Since I think he killfiled you I don't think Randal (one 'l')
will be responding.

> 1.  I mistyped.  I've _never_ seen any suggestion on
> any netiquette list that this sort of question is
> inappropriate.

This is a newsgroup about perl. If your question isn't perl,
consider asking somewhere else, or at least tell us why you
are asking here and why you think it is relevant, if it is
not perl.

> 2.  Nothing was stealth-cc'ed.  I use Outlook, and I
> replied to the group and included you in the cc field.

If you didn't mention that it was posted and mailed in the
body then that's a stealth-cc.

> 3.  I didn't have a hidden agenda.  I know JScript quite
> well and enough Perl to translate a regular expression.

Some perl might not translate, so you are taking chances
there. And a number of other people have posted non-perl
questions here recently and gotten people mad when the
perl answers they got were rejected (since they could not
be translated).

> Why should the list be bothered with the JScript part,
> since it's OT?  I merely mentioned it in my thank-you
> note to you, and didn't ask for any further assistance.

This is not a list. This is a newsgroup. And people get
bothered by javascript since it is off-topic. Very simple.

> 5.  I've asked this on the Javascript lists, and no one
> has proposed an elegant solution.  Since Perl is famous
> for regex wizards (such as yourself, I'm sure), I thought
> I'd give it a shot.

Perl's regex wizards are particularly adept at perl's REs.
Asking them about other regular expressions must be done
with full disclosure.

> 4.  There's no Perl + JScript newsgroup that I'm aware
> of.

That's because they are seperate languages and don't
typically interact, unlike say, perl/tk.

> "Randal L. Schwartz" <merlyn@stonehenge.com> wrote in message
> news:m1n1agp7ed.fsf@halfdome.holdit.com...
> > >>>>> "Tim" == Tim Tabor <tltabor@earthlink.net> writes:

And you posted jeopardy style (answer before the question),
without even trimming Randal's .sig.

Elijah
------
thinks Tim has be reading 'How to Lose Friends and Influence Few'


------------------------------

Date: Tue, 20 Mar 2001 20:34:28 GMT
From: "Tim Tabor" <tltabor@earthlink.net>
Subject: Re: substitution for /^[\w\.]\w*/
Message-Id: <o9Pt6.13852$Im6.1460963@newsread1.prod.itd.earthlink.net>

Thanks Eli.

If these are the rules, I'll follow them.

It was an honest mistake.

1.  I didn't ask anything OT.  I certainly didn't ask anything about
JScript or complain that the Perl solution wouldn't tranlate.

2.  I believe it would have been OT to ask this newsgroup for a
JScript solution.

3.  The answer helped me.  Like I said, I know enough JScript and
Perl to translate.  It was the concept - expressed in Perl, that pointed
me in the right direction.  To me, the concept is helpful across numerous
regular expression engines.

4.  When I commented that there's no Perl + JScript list or newsgroup, my
point was,
there in no precisely _on_ topic venue for this question.  So any
complications
of the answers I get from the specialized newsgroups are mine to suffer.

5.  The stealth-cc is new to me.  Each of Randal's replies was mailed
directly
to me, and I thought replying in kind would be the courteous thing to do.

6.  I thanked the Randal for his help.

I also find it more than passably ironic that my errors are considered
serious offenses, but it's considered perfectly correct for Randal to
address me as bastard, creep, scum, etc., etc, and etc..

But like I said, if these are the rules I'll follow them.  Thank your for
your
explanation.

// tim

"Eli the Bearded" <elijah@workspot.net> wrote in message
news:eli$0103201449@qz.little-neck.ny.us...
> In comp.lang.perl.misc, Tim Tabor <tltabor@earthlink.net> wrote:
> > Randall, this really matters to me.  I'm just a
> > guy who helps others on the lists every day, and
> > occasionally asks for a little assistance myself.
>
> Since I think he killfiled you I don't think Randal (one 'l')
> will be responding.
>
> > 1.  I mistyped.  I've _never_ seen any suggestion on
> > any netiquette list that this sort of question is
> > inappropriate.
>
> This is a newsgroup about perl. If your question isn't perl,
> consider asking somewhere else, or at least tell us why you
> are asking here and why you think it is relevant, if it is
> not perl.
>
> > 2.  Nothing was stealth-cc'ed.  I use Outlook, and I
> > replied to the group and included you in the cc field.
>
> If you didn't mention that it was posted and mailed in the
> body then that's a stealth-cc.
>
> > 3.  I didn't have a hidden agenda.  I know JScript quite
> > well and enough Perl to translate a regular expression.
>
> Some perl might not translate, so you are taking chances
> there. And a number of other people have posted non-perl
> questions here recently and gotten people mad when the
> perl answers they got were rejected (since they could not
> be translated).
>
> > Why should the list be bothered with the JScript part,
> > since it's OT?  I merely mentioned it in my thank-you
> > note to you, and didn't ask for any further assistance.
>
> This is not a list. This is a newsgroup. And people get
> bothered by javascript since it is off-topic. Very simple.
>
> > 5.  I've asked this on the Javascript lists, and no one
> > has proposed an elegant solution.  Since Perl is famous
> > for regex wizards (such as yourself, I'm sure), I thought
> > I'd give it a shot.
>
> Perl's regex wizards are particularly adept at perl's REs.
> Asking them about other regular expressions must be done
> with full disclosure.
>
> > 4.  There's no Perl + JScript newsgroup that I'm aware
> > of.
>
> That's because they are seperate languages and don't
> typically interact, unlike say, perl/tk.
>
> > "Randal L. Schwartz" <merlyn@stonehenge.com> wrote in message
> > news:m1n1agp7ed.fsf@halfdome.holdit.com...
> > > >>>>> "Tim" == Tim Tabor <tltabor@earthlink.net> writes:
>
> And you posted jeopardy style (answer before the question),
> without even trimming Randal's .sig.
>
> Elijah
> ------
> thinks Tim has be reading 'How to Lose Friends and Influence Few'
>




------------------------------

Date: 20 Mar 2001 21:34:33 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: substitution for /^[\w\.]\w*/
Message-Id: <eli$0103201630@qz.little-neck.ny.us>

In comp.lang.perl.misc, Tim Tabor <tltabor@earthlink.net> wrote:
> If these are the rules, I'll follow them.
> 
> It was an honest mistake.
 ...
> I also find it more than passably ironic that my errors are considered
> serious offenses, but it's considered perfectly correct for Randal to
> address me as bastard, creep, scum, etc., etc, and etc..

If Randal is judging you harshly based on those indicators it is
because others doing the same thing have deserved the harsh judgement.

> But like I said, if these are the rules I'll follow them.  Thank your for
> your explanation.
> 
> "Eli the Bearded" <elijah@workspot.net> wrote in message
> news:eli$0103201449@qz.little-neck.ny.us...

You still need to stop the backwards posting. Comment below the
previous poster so that others reading will have the proper
context instantly. And trim the quoted text to the minimum
needed.

Elijah
------
'jeopardy posting' is the term, but is is ugly and awkward


------------------------------

Date: Tue, 20 Mar 2001 15:58:40 -0600
From: Michael Carman <mjcarman@home.com>
Subject: Re: substitution for /^[\w\.]\w*/
Message-Id: <3AB7D290.574A9148@home.com>

[Tim, please don't top-post and quote everything. Place your comments
 directly after the suitably trimmed text of what you're responding 
 to. It's much easier to follow a thread that way.]

Tim Tabor wrote:
> 
> 1.  I didn't ask anything OT.  I certainly didn't ask anything about
> JScript or complain that the Perl solution wouldn't tranlate.

Personally, I don't have a problem with the question you posed, or even
your reasons for doing so -- but only because you're willing to assume
the risk of something not translating. Many people wouldn't be. As long
as you only ask about Perl here, I'm happy, regardless of your reasons
for doing so.

As for Randal, he's pretty focused on helping the Perl community, and
obviously found it offensive that he was being "tricked" into helping
someone with JavaScript instead. I can understand why he'd feel that
way. On top of that, he seems a bit grouchy today. ;) It would have been
better if you had mentioned what you were up to in a side note, but you
probably still would have caught some flak over it.

> 2.  I believe it would have been OT to ask this newsgroup for a
> JScript solution.

Absolutely.
 
> 3.  The answer helped me.  Like I said, I know enough JScript and
> Perl to translate.  It was the concept - expressed in Perl, that pointed
> me in the right direction.  To me, the concept is helpful across numerous
> regular expression engines.

Good. People ask about translating stuff *to* Perl all the time -- I
don't feel this is really any more or less on-topic here. Of course,
that's just my two cents. The rest of the world doesn't always agree
with me.

> 5.  The stealth-cc is new to me.  Each of Randal's replies was mailed
> directly to me, and I thought replying in kind would be the courteous
> thing to do.

In general, anything which could benefit the greater community should be
posted, not mailed. If it's off-topic or private/personal, it should be
mailed, not posted. It is courteous to email a copy of a posted message
to the author of the message you are responding to. However, it's
considered impolite to both post and email a message without making that
clear in the message itself.

Why? Because if you send me a message via email, I'll respond via email.
But if you've also posted to a newsgroup I should respond there instead.
If you don't tell me that you've done both, I have no way of knowing
that.

> I also find it more than passably ironic that my errors are considered
> serious offenses, but it's considered perfectly correct for Randal to
> address me as bastard, creep, scum, etc., etc, and etc..

Most seasoned Usenauts take that sort of stuff as flamebait (even from
one as respected as Randal) and ignore it. That doesn't justify it, but
does explain the silence. Let it slide -- it's not worth the stress.
 
-mjc


------------------------------

Date: Tue, 20 Mar 2001 16:39:24 -0500
From: planb@newsreaders.com (J.B. Moreno)
Subject: substitution/pattern matching -- setting the position...
Message-Id: <1eqkotm.1ar1tfsn8ipb7N%planb@newsreaders.com>

Is there any way to tell a global substition to start the next search at
the same place it started the last one when it has made a SUCCESSFUL
match?

In this particular case I am trying to join several lines together, and
the only way I've found to do that is with a while statement.

$chat = '
john random blahness

john more random blah

john yet more blah

john hasn't any more blah for now

sally has random blah

sally has even more random blah

sally yet more blah';


while ($chat =~ s/\n([hv][^ ]+ )(.+)\n\n\1/\n\1\2 /ig) {
};

works, but, using 5.004, if at all possible I'd like to do it without
the loop (it slows things down).

-- 
JBM
"Your depression will be added to my own" --  Marvin of Borg


------------------------------

Date: Tue, 20 Mar 2001 21:51:08 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: substitution/pattern matching -- setting the position...
Message-Id: <3AB7D26A.306C731A@acm.org>

"J.B. Moreno" wrote:
> 
> Is there any way to tell a global substition to start the next search at
> the same place it started the last one when it has made a SUCCESSFUL
> match?
> 
> In this particular case I am trying to join several lines together, and
> the only way I've found to do that is with a while statement.
> 
> $chat = '
> john random blahness
> 
> john more random blah
> 
> john yet more blah
> 
> john hasn't any more blah for now
> 
> sally has random blah
> 
> sally has even more random blah
> 
> sally yet more blah';
> 
> while ($chat =~ s/\n([hv][^ ]+ )(.+)\n\n\1/\n\1\2 /ig) {
> };
> 
> works, but, using 5.004, if at all possible I'd like to do it without
> the loop (it slows things down).

Define "works". I tried your example and the variable $chat was not
changed at all.


John
-- 
use Perl;
program
fulfillment


------------------------------

Date: 20 Mar 2001 21:27:13 GMT
From: "Scott R. Godin" <webmaster@webdragon.munge.net>
Subject: Re: use Net::SMTP
Message-Id: <998hvh$pf3$0@216.155.33.39>

In article <3AB5AD9A.ABCA7089@courrier.usherb.ca>, jtjohnston 
<jtjohnston@courrier.usherb.ca> wrote:

 | Thanks Garry.
 | 
 | I'm in over my head. I'm just looking for a simple way with Perl to send
 | email from a <form>. use Net::SMTP has been a bust so far. Any 
 | suggestions
 | for perl on a windows box?
 | 
 | I have tried Tod Sambar's mailit.exe,
 | http://www.sambar.com/syshelp/mailit.htm
 | But to be frank mailit will not work because it uses temporary files.
 | 
 | I'm running Perl on a mini-server from a cd rom:
 | http://www.indigostar.com/microweb.htm and need to send data from a
 | <textarea> which can include \r\n Sambar's mailit.exe requires temp 
 | files. I cannot on a cd :)
 | 
 | I would really appreciate email posts and replies. My nntp often loses
 | messages faster than I get back to read them.

you might try the MailTools package.

perl -MCPAN -e shell

cpan> i /mailtools/
CPAN: Storable loaded ok
Going to read Primus 8.5GB:Applications:MacPerl ?:.cpan:Metadata
Distribution id = G/GB/GBARR/MailTools-1.15.tar.gz
    CPAN_USERID  GBARR (Graham Barr <gbarr@pobox.com>)
    CONTAINSMODS Mail::Internet Mail::Header Mail::Send 
Mail::Mailer::test Mail::Field::AddrList Mail::Mailer::mail 
Mail::Mailer::smtp Mail::Cap Mail::Field::Date Mail::Mailer 
Mail::Mailer::sendmail Mail::Util Mail::Field Mail::Mailer::rfc822 
Mail::Address Mail::Filter

cpan> 

THe Mail::Mailer package will send RFC-822-compliant headers, which 
Net::SMTP will *not* do. 

I cannot speak for whether or not it will work when run from a CD or 
not.

-- 
unmunge e-mail here:
#!perl -w
print map {chr(ord($_)-3)} split //, "zhepdvwhuCzhegudjrq1qhw"; 
# ( damn spammers. *shakes fist* take a hint. =:P )


------------------------------

Date: Tue, 20 Mar 2001 21:56:14 +0000 (UTC)
From: langfml@goodall.eng.auburn.edu (Matthew L. Langford)
Subject: user module install under Solaris 8
Message-Id: <998jlu$4vt$1@aunews.duc.auburn.edu>

I would like to allow non-root users to install CPAN modules in their own
directory space.  

This seems like it would be a pretty common wish.  I.e., I want to provide Perl,
and would like to see users really take advantage of it, but I don't have time to
constantly update the myriad of modules, and I'm not particularly willing to
auto-install and auto-update _every_ CPAN module.  Therefore, allowing users to
download and install CPAN modules into their personal directory seems useful.

To test this, I tried to run CPAN with normal privileges.  Installing any module
seemed to immediately try to upgrade the installed Perl to 5.6.0 (I had a Solaris
Perl 5.005 package installed, with the binary in /usr/bin).  (Even though I set
CPAN to ask about prerequisites, and said no.)

So, I built 5.6.0 in my home directory.  When I run CPAN from my perl, it
_still_ uses all the settings from /usr/bin/perl, and so still tries installing
modules to the /usr/perl5 tree.  I tried setting make_arg, makepl_arg, and
make_install_arg with
PREFIX=/home/group/mydir/perl,LIB=/home/group/mydir/perl/lib.  This did not change
the behavior.  The error message looks something like this:

> Running make install
> Warning: You do not have permissions to install into
>   /usr/perl5/site_perl/5.005/sun4-solaris at
>   /usr/perl5/5.00503/ExtUtils/Install.pm line 61.
> mkdir /usr/perl5/5.00503/man: Permission denied at
>   /usr/perl5/5.00503/ExtUtils/Install.pm line 57
> *** Error code 2
> make: Fatal error: Command failed for target `pure_site_install'
>   /usr/ccs/bin/make install
>   PREFIX=/home/group/mydir/perl,LIB=/home/group/mydir/perl/lib -- NOT OK
>    You may have to su to root to install the package

I've also tried setting CCDLFLAGS (which /usr/bin/perl -V shows being set) to
my-directory-relative location.  And just setting LIB, or just setting PREFIX.  To
no avail.  However, replacing /usr/bin/perl with my 5.6.0 build _does_ work.  But
a non-privileged user can't do this, and I don't want to modify the
vendor-supplied perl, and it is on a bunch of machines, and there should be a
workaround anyway.

Why doesn't perl or CPAN use the currently-executing-version of perl to build
INST*, INSTALL*, LIB, and so on?  It appears it uses the definitions of whichever
perl is first in the path.

Given that behavior, though, why isn't PREFIX or LIB overriding those faulty
definitions?  Is there another variable I should use?

Is there a POD which spells all this stuff out?  perlmodinstall doesn't even begin
to cover this special case.




--
MattLangford 


------------------------------

Date: Tue, 20 Mar 2001 14:15:04 -0600
From: Michael Carman <mjcarman@home.com>
Subject: Re: Very new to Perl - desperate for help!
Message-Id: <3AB7BA48.FDC890E@home.com>

Rich Daley wrote:
> 
> I discovered that my web server (f2s.com) didn't include the 
> necessary Perl modules (LWP::Simple and HTTP::Status), so I 
> installed them to ~/www.owl.f2s.com/perl-lib , and added the 
> line "use lib '../perl-lib';" to my script.
> 
> Now all my script returns is
> 
> >ERROR
> >The requested URL could not be retrieved
> >While trying to retrieve the URL:
> >[no URL]
[...]

> #!/usr/bin/perl
> 
> use lib '../perl-lib';

Try replacing this line with these two:

use FindBin;
use lib "$FindBin::Bin/../perl-lib";

Your problem, presumably, is that perl isn't finding your library. '..'
isn't the parent directory of the where the script is located, it's the
parent directory of where the script is *run*.

-mjc


------------------------------

Date: Tue, 20 Mar 2001 21:51:01 -0000
From: "Paul" <paulthomson@hotmail.com>
Subject: was -  way to check a pop3 mailbox without using additional modules?
Message-Id: <3ab7d08c@news1.homechoice.co.uk>

Hi Again,

Thanks for all you positive suggestions last time I posted! After some
pointers I am trying to manually code this. I have successfully started to
communicate with my mailbox but am stuck :(

If I have  messages I get :
+OK paul's mailbox has 1 message(s) (1434 octets)
list:+OK 1 message (1434 octets)

And if I have none:
Sorry, there are no new messages

What I want to do is loop through the messages and list the subjects but I
can't find any resources anywhere for this - even in my perl documentation
(probably me being thick!). Please don't be too harsh on me. I just need a
push in the right direction.

Here's what I have so far:

#!/usr/bin/perl
print "Content-type:text/html\n\n";

  use strict;
  use IO::Socket;

  my ($messages, $PeerAddr, $PeerPort, $count);
$messages="no";

  sub CRLF () { "\015\012" }

  sub cmd {
      my $fh = shift;
      print $fh @_, CRLF;
      my $rc = <$fh>;
      return $rc if $rc =~ /^\+OK/;
      die "error: $rc";
  }



  my $pop3 = IO::Socket::INET->new(
  PeerAddr => 'pop3.myhost.net',
  PeerPort => 'pop3',
  Timeout  => 5
  )
  or die "can't connect to mail server, $!";

  my $resp   = <$pop3>;
  $resp =~ /^\+OK/ or die "$resp";

  my $login  = "myusername";
  my $passwd = "mypass";

  cmd($pop3, "user $login");
  print cmd($pop3, "pass $passwd");
  print "<br>list:";
  print cmd($pop3, "list\r\n<br>");

  if ($messages eq "no") {
  print "Sorry, there are no new messages\n<br><br>";
}
   cmd($pop3, "quit");
  exit 0;

Thanks in advance,

Paul






------------------------------

Date: Tue, 20 Mar 2001 21:43:32 -0000
From: "Paul" <paulthomson@hotmail.com>
Subject: WAS: check a pop3 mailbox without using additional modules
Message-Id: <3ab7ced3@news1.homechoice.co.uk>

Hi Again,

Thanks for all you positive suggestions last time I posted! After some
pointers I am trying to manually code this. I have successfully started to
communicate with my mailbox but am stuck :(

If I have  messages I get :
+OK paul's mailbox has 1 message(s) (1434 octets)
list:+OK 1 message (1434 octets)

And if I have none:
Sorry, there are no new messages

What I want to do is loop through the messages and list the subjects but I
can't find any resources anywhere for this - even in my perl documentation
(probably me being thick!). Please don't be too harsh on me. I just need a
push in the right direction.

Here's what I have so far:

#!/usr/bin/perl
print "Content-type:text/html\n\n";

  use strict;
  use IO::Socket;

  my ($messages, $PeerAddr, $PeerPort, $count);
$messages="no";

  sub CRLF () { "\015\012" }

  sub cmd {
      my $fh = shift;
      print $fh @_, CRLF;
      my $rc = <$fh>;
      return $rc if $rc =~ /^\+OK/;
      die "error: $rc";
  }



  my $pop3 = IO::Socket::INET->new(
  PeerAddr => 'pop3.myhost.net',
  PeerPort => 'pop3',
  Timeout  => 5
  )
  or die "can't connect to mail server, $!";

  my $resp   = <$pop3>;
  $resp =~ /^\+OK/ or die "$resp";

  my $login  = "myusername";
  my $passwd = "mypass";

  cmd($pop3, "user $login");
  print cmd($pop3, "pass $passwd");
  print "<br>list:";
  print cmd($pop3, "list\r\n<br>");

  if ($messages eq "no") {
  print "Sorry, there are no new messages\n<br><br>";
}
   cmd($pop3, "quit");
  exit 0;

Thanks in advance,

Paul




------------------------------

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 V10 Issue 537
**************************************


home help back first fref pref prev next nref lref last post