[16410] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3822 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 27 14:10:29 2000

Date: Thu, 27 Jul 2000 11:10:19 -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: <964721419-v9-i3822@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 27 Jul 2000     Volume: 9 Number: 3822

Today's topics:
    Re: newbie question, can a perl program run 24/7 drdementor@my-deja.com
        nntp client <chris.morris@supanet.net.uk>
    Re: nntp client (Abigail)
    Re: Nobody loves me? <juex@deja.com>
    Re: Perl Mail headers question <andre@UltraShell.Net>
    Re: Perl Mail headers question <jason@mybowie.com>
        Potential perl bug with 'my' variables in modules? <Torsten.Hartmann@nokia.com>
    Re: Problem executing Perl script on Apache server with nobull@mail.com
    Re: Problem executing Perl script on Apache server with nobull@mail.com
        regex email blocker <samay1NOsaSPAM@hotmail.com.invalid>
    Re: return value of `eval "use lib"' <bart.lateur@skynet.be>
    Re: Saving space in a hash <russ_jones@rac.ray.com>
    Re: strict and subroutine variables nobull@mail.com
    Re: To sys op - get me off your email list <Elie.Wildman@spamny.email.gs.com>
    Re: WHOIS not standart query HELP!!! <andre@UltraShell.Net>
    Re: Why won't  "use strict;"  work? (Randal L. Schwartz)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 27 Jul 2000 17:39:03 GMT
From: drdementor@my-deja.com
Subject: Re: newbie question, can a perl program run 24/7
Message-Id: <8lps3n$s1s$1@nnrp1.deja.com>

In article <YFPf5.7375$f_5.31072@news1.rdc1.ct.home.com>,
  decklin+usenet@red-bean.com (Decklin Foster) wrote:
> drdementor@my-deja.com <drdementor@my-deja.com> writes:
>
> > can a perl program run continously?
>
> Yes.
>
> > how is it executed initially then?
>
> The same way you would run any other program.
>
> > what type of file is it?
>
> Perl.

dont worry i wont reinvent the wheeel but my autoresponder is going to
have custom ai in it ,,, I dont want to go in depth into my project but
I need to write my own auto responder... i mean...

i need to read the incomming mail,,, by code alreay in existance or
whatever, the easiest way.....

process the information and generate a unike responce, then mail it
back to the user. I also want to have a delay so that the user thinks a
real tech support represenative helped them...

i hope this better shows what im doing,, yo have been helpfull i am
learning a lot in the past day or 2....

I am trying to figure out what kind of server i need , i need 1000 pop
accounts, not allieses but axxounts and capacity to send out and
recieve 3000 emails a day...

I want a continously running script on the server. i think i need a
virtual server, i could use this for my other sites anyways, but . i
emailed some hosting places and one guy told me to run the email
program on my own pc, and anther guy told me i need a dedicated server
and like a thousand bucks for a bunch fo crap....

is it unusual to run such a program on their server? i mena my virtual
server i would buy?

I guess i can try to write a c++ program , its not what i wanted to do
though... I dont have the books needed to write a x++ email program but
i think i xould find some info somewhere and have a sample program
somewhere if I can without too much trouble decifer the code....



thanks for everyones help


JIm
>
> > does it have to be compiled?
>
> You can write a version of perl that doesn't compile if you like.
>
> > I want a program that will read emails from multiple pop accounts
from
> > the same domain and "digest" the contents of the incomming emails.
>
> I think what you are looking for is called `fetchmail' and `formail',
> not `Perl'.
>
> > is this possible?
>
> Anything's possible, especially not needing to reinvent the wheel.
>
> --
> There is no TRUTH. There is no REALITY. There is no CONSISTENCY. There
> are no ABSOLUTE STATEMENTS. I'm very probably wrong. -- BSD fortune(6)
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 27 Jul 2000 17:21:38 +0100
From: Chris Morris <chris.morris@supanet.net.uk>
Subject: nntp client
Message-Id: <39806192.A13ED925@supanet.net.uk>

Does anyone know of a script that will act as a newsreader?



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

Date: 27 Jul 2000 13:27:33 EDT
From: abigail@foad.org (Abigail)
Subject: Re: nntp client
Message-Id: <slrn8o0s7t.vcg.abigail@alexandra.foad.org>

Chris Morris (chris.morris@supanet.net.uk) wrote on MMDXXII September
MCMXCIII in <URL:news:39806192.A13ED925@supanet.net.uk>:
|| Does anyone know of a script that will act as a newsreader?


perl -e 'exec "slrn"'



Abigail
-- 
$_ = "\x3C\x3C\x45\x4F\x54"; s/<<EOT/<<EOT/e; print;
Just another Perl Hacker
EOT


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

Date: Thu, 27 Jul 2000 10:29:59 -0700
From: "Jürgen Exner" <juex@deja.com>
Subject: Re: Nobody loves me?
Message-Id: <39807186$1@news.microsoft.com>

"Jason Dixon" <jason@mybowie.com> wrote in message
news:397F4B45.C18070AA@mybowie.com...
> Ok, so you'd rather waste both your time and mine by lecturing me on the
> etiquette of Usenet than just offer a hand?  Thanks for wasting my
> bytes.  I would, however, like to thank John and Neil for being productive
> and conducive to the true nature of this newsgroup.
>
> Unfortunately, yes, I resolved to putting up that lame-ass Subject line
> just so I could get a response.  Sorry to have wasted your time, I can see
> that it's obviously too important to spend assisting me.

***PLONK***




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

Date: Thu, 27 Jul 2000 15:39:40 GMT
From: Andre van Straaten <andre@UltraShell.Net>
Subject: Re: Perl Mail headers question
Message-Id: <0JYf5.9426$gU5.233715@news-east.usenetserver.com>

I don't understand which different domain name is in your header. Without
reading the appropriate RFC I'm pretty sure that you cannot compose _ALL_
headers about your origin. If this were the case, all spammers would be
happy.
I don't know if this was your question.
Maybe you post the actual headers, or you have a closer look to the module
documentation or the RFC.

-- avs

Jason Dixon <jason@mybowie.com> wrote:
> Ok, I posted this before but nobody replied.  If this is not the right
> place, someone please point me in the right direction...  :-P

> I've written a script to email a list of people with updates on my
> site.  The script works great, except I'm having difficulty customizing
> the "From" section of the header (no problems at all with the
> "Subject").  Instead of changing the From header to my variable, it uses
> the "real" header (from a machine
> that is NOT in my domain), then inserts the new header into the body of
> the email (???).

> As always, TIA!
> -Jason

> <snippet>
> foreach $name (<INPUT>) {
>         chomp;
>         $from = "Jason <jason\@domain.com>";
>         $subject = "shtuff goes here";
>         $mailer = Mail::Mailer->new("sendmail");
>         $mailer->open({ From    => $from,
>                         To      => $name,
>                         Subject => $subject,
>                         }) || die "can't open: $!";
>         print $mailer $body;
>         $mailer->close();
>         }
> </snippet>


-- 

Andre van Straaten
http://www.vanstraatensoft.com
______________________________________________
flames please to /dev/null@vanstraatensoft.com



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

Date: Thu, 27 Jul 2000 15:33:28 GMT
From: Jason Dixon <jason@mybowie.com>
Subject: Re: Perl Mail headers question
Message-Id: <398066E9.D9AC44E9@mybowie.com>

Andre van Straaten wrote:

> I don't understand which different domain name is in your header. Without
> reading the appropriate RFC I'm pretty sure that you cannot compose _ALL_
> headers about your origin. If this were the case, all spammers would be
> happy.
> I don't know if this was your question.
> Maybe you post the actual headers, or you have a closer look to the module
> documentation or the RFC.
>
> -- avs
>
> Jason Dixon <jason@mybowie.com> wrote:
> > Ok, I posted this before but nobody replied.  If this is not the right
> > place, someone please point me in the right direction...  :-P
>
> > I've written a script to email a list of people with updates on my
> > site.  The script works great, except I'm having difficulty customizing
> > the "From" section of the header (no problems at all with the
> > "Subject").  Instead of changing the From header to my variable, it uses
> > the "real" header (from a machine
> > that is NOT in my domain), then inserts the new header into the body of
> > the email (???).
>
> > As always, TIA!
> > -Jason
>
> > <snippet>
> > foreach $name (<INPUT>) {
> >         chomp;
> >         $from = "Jason <jason\@domain.com>";
> >         $subject = "shtuff goes here";
> >         $mailer = Mail::Mailer->new("sendmail");
> >         $mailer->open({ From    => $from,
> >                         To      => $name,
> >                         Subject => $subject,
> >                         }) || die "can't open: $!";
> >         print $mailer $body;
> >         $mailer->close();
> >         }
> > </snippet>
>
> --
>
> Andre van Straaten
> http://www.vanstraatensoft.com
> ______________________________________________
> flames please to /dev/null@vanstraatensoft.com

Hi Andre:

Yes, I'm probably assuming a LOT about the default sendmail config.  Seeing
as I didn't have any problem customizing the Subject header, I concluded that
the From should be as easy (apparently not).

-Jason



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

Date: Thu, 27 Jul 2000 14:59:29 GMT
From: Torsten Hartmann <Torsten.Hartmann@nokia.com>
Subject: Potential perl bug with 'my' variables in modules?
Message-Id: <39804F9E.A36A0A0E@nokia.com>

Hello,

I recognized a problem with 'my' variables. I have the following
constellation:

The main script calls a subroutine located in a package. This package
has a variable which is declared with 'my' at the top of the package.
The subroutine calls another routine which sets the variable using an
'eval' statement.
The strange behavior is that the variable is defined only if there is a
'print' statement after the 'eval'. If this statement is missing the
variable is not defined in all other routines in the package.
The following example is derived from a more complex script:

The main script:

#! /usr/local/bin/perl
use tstpkg;
tstpkg::hallo();


The package (tstpkg.pm):

package tstpkg;
my $var;
$defstr = '$v' . 'ar=5;';
sub ciao {
  print ":$var\n";
}
sub hallo {
  setvar();
  ciao();
}
sub setvar {
  eval $defstr;
  print "?$var\n"; # If this print is omitted the variable is not
defined outside this subroutine
}
1;

Has anybody an idea about that strange behavior? Is this be a bug in
Perl?

Thanks,

Torsten





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

Date: 27 Jul 2000 17:53:58 +0100
From: nobull@mail.com
Subject: Re: Problem executing Perl script on Apache server with FreeBSD
Message-Id: <u9ya2n4iqh.fsf@wcl-l.bham.ac.uk>

Rodney Engdahl <red_orc@my-deja.com> writes:

> In article <8lp46t$9af$1@nnrp1.deja.com>,
>   apolinad@my-deja.com wrote:
> 
> >
> > Illegal modulus of constant ) in "inputvars="
> >
> > where, "inputvars=" has been declared as an associative array
> > (my % inputvars = &read_query_string) and the said subroutine
> 
> aha!  there is a space between % and inputvars.

And that matters why?

>  that is no associative array, that is a modulus operator.
 
Really.

perl -e 'my % a = (1=>2); print $a{1};'

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 27 Jul 2000 17:55:34 +0100
From: nobull@mail.com
Subject: Re: Problem executing Perl script on Apache server with FreeBSD
Message-Id: <u9snsv4int.fsf@wcl-l.bham.ac.uk>

apolinad@my-deja.com writes:

> When I execute a script (written in Perl 5) in Win NT system, it works
> fine. But when I run the same script on an Apache server (Pair
> Networks), I get an error message as:
> 
> Internal Server Error
> Premature end of script headers: /path/to/myscript.pl
> 
> Moreover, when I tried executing the script on my remote serevr (using
> Telnet), I got a set of errors as:
> 
> Illegal modulus of constant ) in "inputvars="

How did you try executing the script?

This doesn't look like a Perl error to me.  It looks a lot more like
you've fed a Perl script into a script interpreter for some other
language.

Check the shebang line.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Thu, 27 Jul 2000 10:05:37 -0700
From: Samay <samay1NOsaSPAM@hotmail.com.invalid>
Subject: regex email blocker
Message-Id: <02062860.7141b2ce@usw-ex0104-031.remarq.com>

Hi Anyone knows any email service which blocks the email based
upon your regular expressions.. So you don't have to delete the
junk mails?



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

Got questions?  Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com



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

Date: Thu, 27 Jul 2000 15:11:42 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: return value of `eval "use lib"'
Message-Id: <60k0ossf6rcjrr1bujmshiurpsptl6pe2f@4ax.com>

Sweth Chandramouli wrote:

>eval "use lib qw(@INC_DIRS)" or
>   die "Couldn't use libs in \@INC_DIRS!";

Drop the "qw".

	use lib @INC_DIRS;

As for the "eval", It's not such a great idea, if you're not sure you're
using a syntax for which ALL imported functions have parentheses for
their calls. For example,

	eval "use Fcntl";
	print O_CREAT;

will not do the same as

	use Fcntl;
	print O_CREAT;

but this will:

	eval "use Fcntl";
	print O_CREAT();

In short: avoid it, if you can.

For example, fill your @INC_DIRS in a BEGIN block, in front of the "use
lib" line.

-- 
	Bart.


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

Date: Thu, 27 Jul 2000 11:25:58 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: Saving space in a hash
Message-Id: <39806296.54A2870C@rac.ray.com>

Russ Jones wrote:
> 

(Snipped a bunch of useless crap)

> $snmp_data[++$ix] = $msg;
(ditto)
> $hash{$addr} = $ix;
(...)
> $name = gethostbyaddr($addr,2);
(...)
> ($name,$x) = split("\.',$name); # keep the first word of the dns name
(...)
> $hash{$name} = $ix;             # it also points to the string array
(...)
>


Boy am I dumb! I only needed to store the snmp data, in a hash, keyed
by the packed dotted numeric ip. Then in the program that uses the
data, if I don't have a numeric dotted ip to start with, I just use
gethostbyname() and build one. Duh. Saves LOTS more space.

I haven't actually run a full 5000 ip run yet, but so far on my test
data it works like a champ.

ps: Since this news group is run by nappyster like it says in a
different thread, has anyone got any Dan Hicks? How about that one
legendary Johnny Otis (S & the P) album?

(dear usenet topic police: that was a joke)

-- 
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747

Quae narravi, nullo modo negabo. - Catullus


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

Date: 27 Jul 2000 17:54:47 +0100
From: nobull@mail.com
Subject: Re: strict and subroutine variables
Message-Id: <u9vgxr4ip4.fsf@wcl-l.bham.ac.uk>

Pasquale <pdmos23@geocities.com> writes:

> I have some code(below) in a subroutine, that assigns a number.  I need
> that number/variable to be passed to another subroutine further down for
> use.  I read strict, subroutine & variable articles, but they don't seem
> to have what I'm asking (or I don't see it).

The code you quote seems to be unrelated to what you are talking about here.
I suspect you are asking a question that doesn't exist.

>  The closest I've come,
> with the code below, is the number is incremented by 2, i.e.: 2, 4, 6,
> etc.,  not by one.  Why?

Most likely you are calling sub Number twice.

Please post a small self contained bit of code (_not_ a fragment) that
illustrates your problem - I suspect the problem is not in the
fragment you posted.

>  However, the number is displayed.
> I was finished my scripts, but after reading what some of you had to say
> about "use strict" and how it is an important part of a script, I added
> it in.
> If there are any suggestions or articles I can read, please advise.

See FAQ: "I still don't get locking.  I just want to increment the
number in the file.  How can I do this?"

See also the module File::CounterFile.

Not that either of these actually address your question - they address
other bugs in your code.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Thu, 27 Jul 2000 13:57:48 -0400
From: "Wildman, Elie" <Elie.Wildman@spamny.email.gs.com>
Subject: Re: To sys op - get me off your email list
Message-Id: <3980781C.71CA296C@spamny.email.gs.com>

If you don't want perl news from this group what do you wnat?

Gerald Newton wrote:
 I do not want any email about

> perl from this news group.
> Gerald Newton



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

Date: Thu, 27 Jul 2000 15:18:26 GMT
From: Andre van Straaten <andre@UltraShell.Net>
Subject: Re: WHOIS not standart query HELP!!!
Message-Id: <6pYf5.9141$gU5.222890@news-east.usenetserver.com>

This is surely the wrong group to ask this, so maybe you a better one.
But even if it's often difficult to check out who's behind
vanstraatensoft.com, it might be on networksolutions.com or arin.net, I'm
not aware of a database to ask which domain names owns Andre van Straaten.
Was this your question?

-- avs

ilbot@my-deja.com wrote:
> is there any way to get the list of the Domain Names wich were
> registred by some Persons?


> Sent via Deja.com http://www.deja.com/
> Before you buy.

-- 

Andre van Straaten
http://www.vanstraatensoft.com
______________________________________________
flames please to /dev/null@vanstraatensoft.com



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

Date: 27 Jul 2000 08:19:16 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Why won't  "use strict;"  work?
Message-Id: <m1punz7g97.fsf@halfdome.holdit.com>

>>>>> "Petri" == Petri Oksanen <Petri_member@newsguy.com> writes:

Petri> In article <slrn8npmf0.a3e.tadmc@magna.metronet.com>, tadmc@metronet.com says...
>> Controlling variable scope is first-semester CS fodder,
>> are you not a programmer?

Petri> Do you want to limit Perl to be the personal playtoy of a bunch
Petri> of CS geeks sitting around making theoretical solutions to
Petri> theoretical CS problems?  Perl is for everyone who desires to
Petri> use it.

Petri> Everyone can't have, or may not even have had the opportunity
Petri> to pursue, a degree in computer science.  Your remarks are
Petri> unnecessary and insulting to every selftaught hacker out there.

As one of those "selftaught hackers", I'm not insulted, so your remark
is already incorrect.

Variable scoping - some people get it, some people don't.  I wish the
people that don't get it would stay out of writing code, or especially
sharing code.  But that's just my opinion.  For what it's worth.

Programming is a weird art.  The money to be made programming has
attracted a lot of people who really don't belong in the biz.  It's ok
to tinker on your own time, but I see people come through my classes
every week that just really shouldn't be paid as programmers.  They
string together things with cut-n-paste at random.  They seem to lack
the ability to take a concrete example and abstract the essence from
it.  And yet they've been placed into jobs requiring such skills,
either because the employers are so desperate, or they're really good
at BS'ing themselves or their future bosses.

My rule of thumb - anyone who thinks that the act of programming is
worth less than $50/hr should leave the industry. :)

(OK, I'll get flamed on that, but it would sure help me distinguish
what I *can* do in an hour from what most people *attempt* to do in an
hour. :)

Enough random thoughts... enjoy.

-- 
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: 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 3822
**************************************


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