[9337] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2932 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 22 10:07:33 1998

Date: Mon, 22 Jun 98 07:01:04 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 22 Jun 1998     Volume: 8 Number: 2932

Today's topics:
        About this <terra@sti.com.br>
    Re: case-insensitivity (Garp)
    Re: CGI.pm without warnings? <fty@utk.edu>
        E-Mail Validation (easy question) <ozslot@alphalink.com.au>
    Re: E-Mail Validation (easy question) (Michael Fuhr)
    Re: E-Mail Validation (easy question) <rootbeer@teleport.com>
    Re: Flames.... <rootbeer@teleport.com>
    Re: Flames.... (Chris Nandor)
    Re: Flames.... <apminc@cvn.net>
    Re: Flames.... <tchrist@mox.perl.com>
        ftp->get( ) in variable <root@hpux01.hrz.uni-oldenburg.de>
        How to do assignment to OLE property with multiple para <sprugh@telution.com>
    Re: How to find last modified date of a file? <richard@see.my.sig>
    Re: How to find last modified date of a file? <rootbeer@teleport.com>
    Re: How to make 2D indexed array of hash? <tchrist@mox.perl.com>
    Re: Perl and Earth 2025 (Chris Nandor)
        Perl/CGI/Database Programmers needed <thelab@nmarcom.com>
    Re: problems with flock <rootbeer@teleport.com>
        Process management modul? <sturc@pc038b.fzu.cz>
    Re: Script to get all IP addesses in Router-Network <rootbeer@teleport.com>
        Sending files via mail in perl (xholf03)
    Re: Sending mail in Perl (Collin Rogowski)
    Re: Sending mail in Perl <xxxgormxxx@p4.no>
    Re: Sending mail in Perl <rra@stanford.edu>
        Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
        the @-sign <Robert.Rehammar@emw.ericsson.se>
    Re: Uploading perl scripts with a perl script. <perlguy@inlink.com>
    Re: writing a mud in perl (Greg Bacon)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Thu, 18 Jun 1998 12:20:00 -0300
From: Terracini <terra@sti.com.br>
Subject: About this
Message-Id: <35893020.FCCBE348@sti.com.br>

Hello,
I would like to know about:
Socket- STDIN/STDOUT and SERVER PUSH.
If someone can tell me about...


Thanks,
Fabio Terracini



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

Date: Mon, 22 Jun 1998 13:50:27 GMT
From: garp@callscan.com.nospam (Garp)
Subject: Re: case-insensitivity
Message-Id: <358e5ff3.252894813@news.demon.co.uk>

On Mon, 22 Jun 1998 10:11:00 +0200, Jonas Kihlsten
<"qtxjoki"@vg.ao,.ericsson.se> wrote:

>Does anyone know how to ignore case-sensivity when scaning through a
>textfile?

If you mean "scanning a string", you'll find the 'i' option on a regex
useful. Try the perlre online docs for more info. Primitive grep-style
example follows...

$_=shift;
open(H,$_) or die("Can't open $_, stopped");
while(<H>)
{
	print if /searchstring/i;
}
close H or die("Can't close. That's odd.");


HTH
Garp


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

Date: Mon, 22 Jun 1998 08:50:29 -0400
From: Jay Flaherty <fty@utk.edu>
To: Tom Mornini <tmornini@netcom.com>
Subject: Re: CGI.pm without warnings?
Message-Id: <358E5315.F4DBBFE7@utk.edu>

Tom Mornini wrote:
> 
> I've been developing an app with CGI.pm and have learned
> a great deal about it. I recently got down to some actual
> control code that decides what to do based upon multiple
> Submit buttons with different names with code that looks
> like this:
> 
> if ($query->param('Submit') eq 'Button 1') {#code here}
> 
> if ($query->param('Submit') eq 'Button 2') {#code here}
> 
> If Submit Button 1 or 2 is pressed, the opposite conditional
> complains about "Use of uninitialized value at line #" since
> I have -w (warnings) turned on (and use strict, too!).
> 
> I'd like this code to be picture perfect. How can I avoid
> this?

Pre-declare your variables using use vars qw($var1,$var2); or 
my($var1,$var2);

jay
--
**********************************************************************  
Jay Flaherty                                               fty@utk.edu
"Once in awhile you get shown the light, in the strangest of places if
you look at it right" - R. Hunter
**********************************************************************


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

Date: Mon, 22 Jun 1998 22:38:40 +1000
From: David Hamilton <ozslot@alphalink.com.au>
Subject: E-Mail Validation (easy question)
Message-Id: <358E5050.13B268C4@alphalink.com.au>

Hello,

        I am very stupid at PERL and I have the following code to do
something if an E-Mail address exists and is in valid format:

if ($INPUT{'email'}) {
 if ($INPUT{'email'} =~ /(.*)@(.*)/) {
 }
}

My easy question is: how do I reverse this check (without simply adding
an ELSE type thing) so that it will do something if $INPUT{'email'}
doesn't exist or doesn't conform to: =~ /(.*)@(.*)/)

Please can someone E-Mail me with their answer to this.

Thanks,
>From David Hamilton
hamilton@melbpc.org.au



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

Date: Mon, 22 Jun 1998 13:52:07 GMT
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: E-Mail Validation (easy question)
Message-Id: <6mlnhr$ohh@flatland.dimensional.com>

David Hamilton <ozslot@alphalink.com.au> writes:

>         I am very stupid at PERL and I have the following code to do
> something if an E-Mail address exists and is in valid format:
>
> if ($INPUT{'email'}) {
>  if ($INPUT{'email'} =~ /(.*)@(.*)/) {
>  }
> }
>
> My easy question is: how do I reverse this check (without simply adding
> an ELSE type thing) so that it will do something if $INPUT{'email'}
> doesn't exist or doesn't conform to: =~ /(.*)@(.*)/)

My ease answer is: check the FAQ and the numerous threads on this topic:

    http://language.perl.com/faq/
    http://www.dejanews.com/

If your question is more one of syntax, then check out the Perl manual
pages.

-- 
Michael Fuhr
http://www.dimensional.com/~mfuhr/


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

Date: Mon, 22 Jun 1998 13:54:01 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: E-Mail Validation (easy question)
Message-Id: <Pine.GSO.3.96.980622064200.6310O-100000@user2.teleport.com>

On Mon, 22 Jun 1998, David Hamilton wrote:

>         I am very stupid at PERL and I have the following code to do
> something if an E-Mail address exists and is in valid format:
> 
> if ($INPUT{'email'}) {
>  if ($INPUT{'email'} =~ /(.*)@(.*)/) {

That pattern will match the same set of strings that /@/ will, although
you'll get $1 and $2 from yours. But if you're going to do some kind of
further checking on $1 and $2, you should be aware that, surprisingly
enough, a valid email address may have more than one @-sign, like the one
shown here. (Try it in any RFC-822-compliant mail program, if you don't
believe me! Also, the FAQ talks about validating email addresses.) 

    fred"@"barney(this @ is okay)@redcat.com(this @ is okay!)

> My easy question is: how do I reverse this check (without simply adding
> an ELSE type thing) so that it will do something if $INPUT{'email'}
> doesn't exist or doesn't conform to: =~ /(.*)@(.*)/)

I'm not sure that I understand what you're asking for, but I think you
want something roughly resembling this:

    if ($email and $email =~ /@/) {
	print "So far so good...\n";
    } else {
	print "No, that can't be right...\n";
    }

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 22 Jun 1998 12:37:54 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Flames....
Message-Id: <Pine.GSO.3.96.980622052808.6310N-100000@user2.teleport.com>

On Mon, 22 Jun 1998 birgitt@my-dejanews.com wrote:

> > If someone isn't reading what's already out there, why would 
> > additional postings make a difference?
> 
> Because you can't conclude from the fact that the first time poster
> who hasn't read what is already out there, *will* not read
> what is out there, you can only conclude he hasn't read the material
> when you *expect* him *having read* the material.

I'm not sure I understand that. But maybe my question was unclear.

I believe that you're saying that we can't conclude that the person who
hasn't read in the past would never read your proposed postings in the
future. Agreed. But my question is, why _would_ the person who hasn't read
postings in the past suddenly decide to read your proposed postings? 

Posting a message telling people to read is like the Flight Attendant
announcing that "passengers must obey the instructions of the Flight
Crew". If the passengers aren't intending to obey instructions, why
would they decide to obey that one? 

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 22 Jun 1998 13:04:52 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Flames....
Message-Id: <pudge-2206980902060001@dynamic52.ply.adelphia.net>

In article <358d9bd3.351150@news.tc.umn.edu>, ames0009@tc.umn.edu wrote:

# On Sun, 21 Jun 1998 17:00:00 GMT, chip@mail.atlantic.net (Chip
# Salzenberg) wrote:
# 
# >Why should it be too much to expect that a person wanting to learn
# >about a *programming*language* know how to grep?!
# 
# That's the whole point. Your talking about people who are trying to
# learn what "grep" is -- but you are assuming (as many posters do) that
# a novice should already know something before they even ask. Why would
# they ask if they knew how to get the answer already?  

Where does it end?  When someone asks how to turn the computer on?  Where
the Any key is?  You have to know how to use a computer before you can
program it, period.  There are degrees of usage, and degrees of
programming, but if you cannot search a text file, at LEAST go to an
appropriate place to learn it, which is NOT a programming newsgroup.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: Mon, 22 Jun 1998 08:14:47 -0400
From: Chris Miller <apminc@cvn.net>
To: "Michael D. Schleif" <mike.schleif@aquila.com>
Subject: Re: Flames....
Message-Id: <358E4AB7.A4336B7E@cvn.net>

> I tend to keep my mouth shut while reading this newsgroup, but I figured I
> should open it for just a second.  I happen to be a "newbie" (god, I hate
> that word) around here.  And I was one of those who one day had a question
> and decided I would try the newsgroups (which I'd never done before).
> Thankfully I got a helpful response from someone who also answered a few
> other questions for me at his prompting.  Yeah, they were dumb questions
> which I coulda answered by searching through some faqs for a hour or so,
> but I'm at work now and I don't have a hour or so to browse a faq.



> In short, most newbie questions are ones they ask to

> A) get a kickstart on the whole thing (i.e. me)

B) answer something which is so simple it's not worth taking the time to
browse the faq

I have seen many many long letters in here concerning this whole issue.  So
many so, that when I originally wasn't going to read the flame posts, I
stopped scrolling and read them all.  If you have the time and patience to
write all this, is it honestly that hard to answer something which could
most likely be answered with a few sentences or a polite direction to a
relevant faq.  Plus, if you can take the time to tell someone to shove off,
you could just as easily take the time to do one of the above options.

It seems that newbies are comparable to flies around here.  You tolerate
them for awhile but you're annoyed to all hell by them.  Lighten up a bit.
Don't respond if you don't want to be bothered.

I posted Mr. Schleif's message below since he seems to mirror some of my
opinions with his remarks.

All done speaking, back to the background

Chris "The newbie" Miller

> To the point: When reading "stupid" newsgroup postings, either post a
> truly constructive reply, or remain mute.
>
> I firmly believe that if NOBODY responds to a posting, the poster will
> soon go away -- if that is what you want, don't stir them up, prompting
> them to continue in your newsgroup by posting further, in defense of
> their spat upon honor -- they will only stick around longer and irritate
> you further.  Surely, you do not get paid enough for that . . .





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

Date: 22 Jun 1998 13:44:06 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Flames....
Message-Id: <6mln36$v6$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    Chris Miller <apminc@cvn.net> writes:
:Plus, if you can take the time to tell someone to shove off,
:you could just as easily take the time to do one of the above options.

If you can take the time to tell a panhandler to shove off, you can take
the time to give him a quarter.  Do you do this?  Every time?  Really?
There are a lot of needy causes -- make sure not to deny any of them.

--tom
-- 
There are many times when you want it to ignore the rest of the string just
like atof() does.  Oddly enough, Perl calls atof().  How convenient.  :-)
        --Larry Wall in <1991Jun24.231628.14446@jpl-devvax.jpl.nasa.gov>


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

Date: Mon, 22 Jun 1998 15:07:56 +0200
From: Juergen Weiss <root@hpux01.hrz.uni-oldenburg.de>
Subject: ftp->get( ) in variable
Message-Id: <358E572C.14D5@hpux01.hrz.uni-oldenburg.de>

Is there any chance to redirect the output from ftp->get( <file>, <file>
) 
fro, Net::FTP into an list, array, hash.

-- 
+----------------------------------------------------------------------+
+ Juergen Weiss                EMAIL: root@unixen.hrz.uni-oldenburg.de |
+ Hochschulrechenzentrum       TEL:   +49 0441 7984407                 |
+ Universitaet Oldenburg       FAX:   +49 0441 7984413                 |
+ Carl v. Ossietzky Str. 9-11  http://www.hrz.uni-oldenburg.de/~weiss  |
+----------------------------------------------------------------------+
+


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

Date: Mon, 22 Jun 1998 07:52:40 -0500
From: "Scott T. Prugh" <sprugh@telution.com>
Subject: How to do assignment to OLE property with multiple params??
Message-Id: <6mlk3h$o4g$1@eve.enteract.com>

I'm using the OLE module to automate some tasks, and I'm having problems
assigning to properties that have multiple input parameters:

The midl looks like this:

        [id(0x00000001), propput, helpstring("Sets a property value")]
        void Value([in] BSTR bstrPropName, [in] VARIANT rhs);

I can't seem to get the syntax right to set this property.  The normal
$obj->{'foo'} does not work.

Essentially, the call I want to make is:

$obj->Value("Name") = "ThisIsSomeText";

This of course cannot be done because you must use the {''} for rvalue
assignments as per the examples included with the Win32 versions of Perl.

I also tried:

$obj->Value{'Name'} = "ThisIsSomeText";
$obj->Value("Name","ThisIsSomeText");

But no luck....

Does anyone have any ideas?  I appreciate the help...

Regards,
    Scott











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

Date: Mon, 22 Jun 1998 13:41:34 +0100
From: "Richard G. Coleman" <richard@see.my.sig>
Subject: Re: How to find last modified date of a file?
Message-Id: <b40bOCA+Dlj1EwF5@alchemedia.co.uk>

In article <6mlfv5$vnq$1@strato.ultra.net>, Bob Trieger
<sowmaster@juicepigs.com> writes
>"Richard G. Coleman" <richard@see.my.sig> wrote:
>> How do I extract the last modified date / time of a file eg a data file
>-> and print it on an html page.
>
>perldoc -f stat
>perldoc -f print
>
>HTH

I need to put these in a perl script eg

print "That file was modified on ";
print {code to get date of file};


I don't know how to include this in the script.
>
>Bob Trieger
>sowmaster@juicepigs.com
>" Cost a spammer some cash: Call 1-800-286-0591
>  and let the jerk that answers know that his
>  toll free number was sent as spam. "

-- 
             Richard G. Coleman  |  richard@alchemedia.co.uk
     Alchemedia Interactive Ltd  |  http://www.alchem.demon.co.uk/
     -------------------------------------------------------------
  


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

Date: Mon, 22 Jun 1998 13:56:31 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: How to find last modified date of a file?
Message-Id: <Pine.GSO.3.96.980622065435.6310Q-100000@user2.teleport.com>

On Mon, 22 Jun 1998, Richard G. Coleman wrote:

> >perldoc -f stat
> >perldoc -f print

> I need to put these in a perl script eg
> 
> print "That file was modified on ";
> print {code to get date of file};
> 
> 
> I don't know how to include this in the script.

The person you quoted above was trying to tell you to write some code that
uses the functions 'stat' and 'print', whose documentation you can read
with the perldoc program. Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 22 Jun 1998 13:06:21 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to make 2D indexed array of hash?
Message-Id: <6mlksd$rfv$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, lucasdave@hotmail.com writes:
:Could someone please show me a few examples of defining this
:array, getting to various fields in it, and passing it to a subroutine. 

Sure, I did this for you already in the standard perldsc manpage
included with every Perl release.  

--tom
-- 
    X-Windows: It was hard to write; it should be hard to use.
	--Jamie Zawinski


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

Date: Mon, 22 Jun 1998 12:49:44 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Perl and Earth 2025
Message-Id: <pudge-2206980846580001@dynamic52.ply.adelphia.net>

In article <6mjjcb$5k2$1@supernews.com>, petdance@maxx.mc.net (Andy
Lester) wrote:

# : # I want to write a game like the webgame Earth 2025 
# : # (http://www.solarianet.com/earth/) in Perl.
# : # However im not sure it's possible in Perl...
# : # could one of you guys take a look at this game
# : # and tell me if it is possible?
# 
# : No.
# 
# It's not possible using U.S. Standard Perl, but I think if you buy the
# Online Game Add-On Pack (OGAOP), it should be OK.  

Oh, you thought I was being helpful when I said "No."  On the contrary, I
was not saying it cannot be done, but only that one of us guys would not
tell him whether or not it is possible.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: Mon, 22 Jun 1998 09:33:10 -0400
From: "Will Mitayai Keeso Rowe" <thelab@nmarcom.com>
Subject: Perl/CGI/Database Programmers needed
Message-Id: <6mlmff$d9c$1@unix.nmarcom.com>


My company, Neray MarCom, Inc., located in Toronto, Canada is looking for
Freelance Perl Programmers with experience in CGI programming. Database
access programming would be an asset, but not necessary.

For information on our company, check out http://www.nmarcom.com.

Please forward any inquiries or requests for more information to:

curio@nmarcom.com

If you send them to me, they'll get buried in my inbox for quite some time
:(

-Mit
---
Will Mitayai Keeso Rowe [WMR2]
Systems Administrator/Programmer/Webmaster
thelab@nmarcom.com - work
mitayai@dreaming.org - home
ICQ: #7161728




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

Date: Mon, 22 Jun 1998 12:20:19 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: problems with flock
Message-Id: <Pine.GSO.3.96.980622051627.6310L-100000@user2.teleport.com>

On 21 Jun 1998, Brian L. Matthews wrote:

> In perlfunc under flock we find:
> 
> 		"To avoid the possibility of mis-coordination, Perl flushes
> 		 FILEHANDLE before (un)locking it."
> 
> So, is this not what happens? And if not, why not?

That feature was added recently, in version 5.004. Although everyone
_should_ be using that version by now, not everyone is doing so. Alas! 

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 22 Jun 1998 13:00:53 GMT
From: <sturc@pc038b.fzu.cz>
Subject: Process management modul?
Message-Id: <6mlki5$o7v$2@ns.felk.cvut.cz>

 Hi all,

 I need a modul for $subject ( proces killing, suspending,
 getting process info etc. ) Something like libproc for C
 in Linux, but portable (Solaris, IRIX).

 Any help?

 Thanx Petr 
-- 

--
 
 -----------------------------------------------------------
|  Ing. PETR STURC                                          |
|  DEPT. OF MAGNETISM             tel. +42 2 6605-2705      |
|  INSTITUTE OF PHYSICS AV CR     tel. +42 2 6605-2108      |
|  NA SLOVANCE 2                  fax. +42 2 821227         |
|  CZ 180 40 PRAHA 8              E-mail: sturc@fzu.cz      |
|  CZECH REPUBLIC                 http://www.fzu.cz/~sturc/ |
|                                                           |
 -----------------------------------------------------------


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

Date: Mon, 22 Jun 1998 12:26:32 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Script to get all IP addesses in Router-Network
Message-Id: <Pine.GSO.3.96.980622052124.6310M-100000@user2.teleport.com>

On Mon, 22 Jun 1998, Michael Beckers wrote:

> 1. I am an absolut beginner in Perl.
> 2. I am looking for a script which can tell me which IP-Addresses    are
> avaiable in a small Router-Network.

Are you looking to merely _find_ (as opposed to write) a program? Perhaps
one of the many software archives would have something that might suit
your needs.

If you're looking to write a program like this, though, you'll first need
to find out how a program might get that information. Then you can see
about implementing that algorithm (in Perl, or in any other language). For
example, perhaps the information you want could be deduced from the
contents of a file, or perhaps you need to do something with sockets. (In
fact, it's not clear from your question what "available" means - do you
mean unused addresses or ones which are in use, and thus available for
connecting to?) The docs, FAQs, and newsgroups about your network should
be helpful.

Good luck! 

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 22 Jun 1998 13:16:21 GMT
From: xholf03@vse.cz (xholf03)
Subject: Sending files via mail in perl
Message-Id: <6mllf5$oq4@vse470.vse.cz>

Hello again,
don't you know how to send files via mail (using sendmail)?
I hoped that puting new line is enough:
print Mail "attachmnt: 1. /my_path/my_file \n";
but it is not.
Could you help me?
Thanks much.
		filip



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

Date: Mon, 22 Jun 1998 13:29:23 GMT
From: collin@rogowski.de (Collin Rogowski)
Subject: Re: Sending mail in Perl
Message-Id: <358e5c03.7083054@news.uni-X.net>

On 22 Jun 1998 09:23:13 GMT, xholf03@vse.cz (xholf03) wrote:

>Hello,
>week ago i've started to learn perl ... (so i don't know anything)
>I've got problem with sending mail. Please, could you tell me what's wrong 
>with this?
>
>#!/usr/bin/perl -w
>$from = 'xholf03@sorry.vse.cz';
>$to = 'xholf03@vse.cz';
>
>open (Mail, "/usr/bin/sendmail");
>print Mail "To: $to\n";
>print Mail "From: $from\n";
>print Mail "Subject: send\n";
>print Mail ".\n";
>close (Mail);
>
>Thanks much.
>filip
>

I#m not an sendmail expert, but on our system you have to use
"sendmail -bd -q1h" to send mail manually from the commandline.

Collin Rogowski


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

Date: 22 Jun 1998 15:39:40 +0200
From: Gorm Haug Eriksen <xxxgormxxx@p4.no>
Subject: Re: Sending mail in Perl
Message-Id: <m3hg1dftcz.fsf@tehran.p4inet.no>

xholf03@vse.cz (xholf03) writes:

> #!/usr/bin/perl -w
> $from = 'xholf03@sorry.vse.cz';
> $to = 'xholf03@vse.cz';
> 
> open (Mail, "/usr/bin/sendmail");

You should open it as a command, and not as a file. 

open(Mail, "/usr/bin/sendmail|") || die;
			     ^---- pipe 
- Gorm




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

Date: 22 Jun 1998 06:43:02 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Sending mail in Perl
Message-Id: <m34sxdo8m1.fsf@windlord.Stanford.EDU>

Collin Rogowski <collin@rogowski.de> writes:

> I'm not an sendmail expert, but on our system you have to use "sendmail
> -bd -q1h" to send mail manually from the commandline.

You have a very odd system.

(-bd means run as a daemon, -q1h means run the queue every hour, neither
has anything to do with sending mail from the command line.  A standard
set of flags are -oi -oem and -t if you're giving the addresses inside the
message.)

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 22 Jun 1998 13:30:19 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <6mlm9b$es2$2@info.uah.edu>

Following is a summary of articles spanning a 7 day period,
beginning at 15 Jun 1998 13:14:25 GMT and ending at
22 Jun 1998 06:29:21 GMT.

Notes
=====

    - A line in the body of a post is considered to be original if it
      does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
    - All text after the last cut line (/^-- $/) in the body is
      considered to be the author's signature.
    - The scanner prefers the Reply-To: header over the From: header
      in determining the "real" e-mail address and name.
    - Original Content Rating (OCR) is the ratio of the original content
      volume to the total body volume.
    - Find the News-Scan distribution on the CPAN!
      <URL:http://www.perl.com/CPAN/modules/by-module/News/>
    - Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
    - Copyright (c) 1998 Greg Bacon.  All Rights Reserved.
      Verbatim copying and redistribution is permitted without royalty;
      alteration is not permitted.  Redistribution and/or use for any
      commercial purpose is prohibited.

Excluded Posters
================

perlfaq-suggestions\@mox\.perl\.com

Totals
======

Posters:  517
Articles: 1528 (634 with cutlined signatures)
Threads:  438
Volume generated: 2549.7 kb
    - headers:    1057.0 kb (21,256 lines)
    - bodies:     1395.1 kb (42,848 lines)
    - original:   953.6 kb (31,456 lines)
    - signatures: 96.1 kb (2,112 lines)

Original Content Rating: 0.684

Averages
========

Posts per poster: 3.0
    median: 1 post
    mode:   1 post - 326 posters
    s:      7.7 posts
Posts per thread: 3.5
    median: 2.0 posts
    mode:   1 post - 131 threads
    s:      5.7 posts
Message size: 1708.7 bytes
    - header:     708.4 bytes (13.9 lines)
    - body:       934.9 bytes (28.0 lines)
    - original:   639.1 bytes (20.6 lines)
    - signature:  64.4 bytes (1.4 lines)

Top 10 Posters by Number of Posts
=================================

         (kb)   (kb)  (kb)  (kb)
Posts  Volume (  hdr/ body/ orig)  Address
-----  --------------------------  -------

  142   203.7 (110.8/ 75.9/ 48.7)  Tom Phoenix <rootbeer@teleport.com>
   55    97.0 ( 36.0/ 56.1/ 30.0)  lr@hpl.hp.com (Larry Rosler)
   34    53.7 ( 26.3/ 27.4/  8.9)  bowlin@sirius.com
   26    37.2 ( 17.2/ 20.0/ 10.6)  sowmaster@juicepigs.com (Bob Trieger)
   26    36.9 ( 18.0/ 14.7/  8.2)  "F.Quednau" <quednauf@nortel.co.uk>
   24    36.3 ( 13.7/ 22.7/ 16.5)  mjd@op.net (Mark-Jason Dominus)
   23    35.8 ( 18.4/ 14.4/ 11.0)  tchrist@mox.perl.com (Tom Christiansen)
   22    44.4 ( 17.7/ 22.8/ 10.4)  abigail@fnx.com
   22    29.2 ( 16.8/ 12.2/  6.1)  jdporter@min.net
   21    41.3 ( 17.7/ 18.2/ 10.1)  rjk@coos.dartmouth.edu (Ronald J Kimball)

These posters accounted for 25.9% of all articles.

Top 10 Posters by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Address
--------------------------  -----  -------

 203.7 (110.8/ 75.9/ 48.7)    142  Tom Phoenix <rootbeer@teleport.com>
  97.0 ( 36.0/ 56.1/ 30.0)     55  lr@hpl.hp.com (Larry Rosler)
  53.7 ( 26.3/ 27.4/  8.9)     34  bowlin@sirius.com
  44.4 ( 17.7/ 22.8/ 10.4)     22  abigail@fnx.com
  41.3 ( 17.7/ 18.2/ 10.1)     21  rjk@coos.dartmouth.edu (Ronald J Kimball)
  37.2 ( 17.2/ 20.0/ 10.6)     26  sowmaster@juicepigs.com (Bob Trieger)
  36.9 ( 18.0/ 14.7/  8.2)     26  "F.Quednau" <quednauf@nortel.co.uk>
  36.3 ( 13.7/ 22.7/ 16.5)     24  mjd@op.net (Mark-Jason Dominus)
  35.8 ( 18.4/ 14.4/ 11.0)     23  tchrist@mox.perl.com (Tom Christiansen)
  35.0 ( 12.6/ 22.4/ 14.3)     19  cberry@cinenet.net (Craig Berry)

These posters accounted for 24.4% of the total volume.

Top 10 Posters by OCR (minimum of five posts)
==============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.994  (  3.3 /  3.3)      6  gabor@vmunix.com (Gabor)
0.989  ( 16.0 / 16.1)     18  pudge@pobox.com (Chris Nandor)
0.989  (  3.6 /  3.6)     10  perlguy@technologist.com
0.975  ( 12.1 / 12.4)      5  Nathan Torkington <gnat@frii.com>
0.969  (  9.1 /  9.4)     10  due@murray.fordham.edu (Allan M. Due)
0.917  ( 11.4 / 12.4)     16  gebis@albrecht.ecn.purdue.edu (Michael J Gebis)
0.915  (  4.1 /  4.5)      5  steph@hotkey.net.au
0.862  (  6.8 /  7.9)      8  scott@softbase.com
0.827  (  5.1 /  6.2)      5  abraham@mpi.com
0.806  (  3.4 /  4.2)      6  "Matthew O. Persico" <mpersico@erols.com>

Bottom 10 Posters by OCR (minimum of five posts)
=================================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.485  ( 10.3 / 21.2)     12  Lloyd Zusman <ljz@asfast.com>
0.472  (  4.4 /  9.3)      7  Jan Krynicky <JKRY3025@comenius.ms.mff.cuni.cz>
0.457  ( 10.4 / 22.8)     22  abigail@fnx.com
0.435  (  4.9 / 11.4)     18  ilya@math.ohio-state.edu (Ilya Zakharevich)
0.432  (  3.0 /  7.0)      9  kpreid@ibm.net (Kevin Reid)
0.425  (  5.5 / 12.9)     13  Deva Seetharam <psdspss@execpc.com>
0.423  (  5.7 / 13.5)     15  Ala Qumsieh <aqumsieh@matrox.com>
0.394  (  4.2 / 10.7)     16  mjtg@cus.cam.ac.uk (M.J.T. Guy)
0.346  (  2.4 /  6.9)      6  kortbein@iastate.edu (Josh Kortbein)
0.326  (  8.9 / 27.4)     34  bowlin@sirius.com

62 posters (11%) had at least five posts.

Top 10 Threads by Number of Posts
=================================

Posts  Subject
-----  -------

   67  first language
   49  Flames....
   48  REVIEW: Perl CGI Programming - No Experience Required
   21  Pod::Text -- Unix only?
   19  the ?PATTERN? match syntax
   18  2 questions about lists
   16  Curly braces in if elsif contructs
   16  ?CGI scripts & Explorer
   14  if (something eq "somethingfgjhf")
   13  getting first letter of a string

These threads accounted for 18.4% of all articles.

Top 10 Threads by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Subject
--------------------------  -----  -------

 165.7 ( 55.2/103.6/ 61.0)     67  first language
 105.2 ( 42.8/ 57.3/ 36.0)     48  REVIEW: Perl CGI Programming - No Experience Required
 101.5 ( 38.1/ 57.3/ 37.4)     49  Flames....
  36.5 ( 12.6/ 23.3/ 14.8)     16  ?CGI scripts & Explorer
  35.0 ( 15.6/ 17.1/ 12.7)     21  Pod::Text -- Unix only?
  33.0 ( 12.3/ 19.3/ 12.4)     18  2 questions about lists
  29.1 ( 13.0/ 15.1/  8.6)     19  the ?PATTERN? match syntax
  26.2 ( 10.7/ 14.9/ 10.6)     16  Curly braces in if elsif contructs
  21.9 (  9.5/ 12.0/  7.2)     14  if (something eq "somethingfgjhf")
  21.9 ( 10.1/ 11.2/  6.9)     11  Have we got a good free Perl manual?

These threads accounted for 22.6% of the total volume.

Top 10 Threads by OCR (minimum of five posts)
==============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Subject
-----  --------------  -----  -------

0.901  (  2.0/   2.2)      5  How can I run Perl in Microsoft Access ?
0.866  ( 10.9/  12.6)      5  Perl CGI forms
0.854  (  3.5/   4.1)      5  HELP :  Socket Problems with NT 4 Perl
0.843  (  4.4/   5.2)      8  problems with flock
0.843  (  2.3/   2.8)      5  modperl on NT
0.812  (  3.8/   4.7)      5  Moving application from DOS to a GUI.
0.787  (  6.8/   8.6)     10  A funny problem with "use integer"
0.771  (  2.4/   3.1)      5  subject and sender using open mail
0.744  (  2.2/   3.0)      5  Duplicate emails with sendmail!
0.741  ( 12.7/  17.1)     21  Pod::Text -- Unix only?

Bottom 10 Threads by OCR (minimum of five posts)
=================================================

         (kb)    (kb)
OCR      orig /  body  Posts  Subject
-----  --------------  -----  -------

0.515  (  2.6 /  5.0)      6  grep question
0.514  (  3.2 /  6.2)      9  How do you pre-append using "open"
0.469  (  1.9 /  4.0)      5  subroutines
0.442  (  3.0 /  6.9)     10  print <<END (with variables)
0.436  (  1.8 /  4.1)      5  perl cgi generated html with java app "class not found"
0.435  (  2.4 /  5.4)      7  simple expression matching problem
0.416  (  2.4 /  5.7)      7  Appending one file to another
0.374  (  2.9 /  7.8)      7  Sending file with Perl Script
0.338  (  2.0 /  5.9)      5  Win NT- CGI script help please
0.326  (  0.8 /  2.5)      5  perl command line options

89 threads (20%) had at least five posts.

Top 10 Targets for Crossposts
=============================

Articles  Newsgroup
--------  ---------

      33  comp.lang.c
      32  comp.programming
      25  comp.lang.perl.modules
      11  gnu.misc.discuss
      10  comp.lang.perl
       6   comp.lang.perl.misc
       6  alt.perl
       5  comp.unix.admin
       5  comp.lang.javascript
       5  comp.lang.python

Top 10 Crossposters
===================

Articles  Address
--------  -------

       8  mjd@op.net (Mark-Jason Dominus)
       7  "George Buyanovsky" <buyanovs@sgci.com>
       6  hex@voicenet.com (Matt Knecht)
       6  "Judson McClendon" <judmc123@bellsouth.net>
       6  pfaffben@pilot.msu.edu
       5  lr@hpl.hp.com (Larry Rosler)
       4  jesteel@compugen.net (Jason E. Steele)
       4  Tom Phoenix <rootbeer@teleport.com>
       4  "Slip.Net User" <somekidd@slip.net>
       4  firewind <firewind@metroid.ml.org>


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

Date: Mon, 22 Jun 1998 15:20:59 +0100
From: Robert Rehammar <Robert.Rehammar@emw.ericsson.se>
Subject: the @-sign
Message-Id: <358E684A.8AB79AC6@emw.ericsson.se>

Hi !

We'r two newbees on Perl wondering what the @-sign ahed of a variable
means ??

If anyone could point us to any _GOOD_ book on the web we'd be greatful
!

answer to: robert.rehammar@emw.ericsson.se

Robert Rehammar


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

Date: Mon, 22 Jun 1998 12:01:17 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: Uploading perl scripts with a perl script.
Message-Id: <358E478D.992BAD6C@inlink.com>

When all else fails, and I mean ALL.

And if it is possible to telnet from behind your firewall...

Copy the Perl script to your clipboard and then past it into a new file
that you opened with vi.

I have done this in the past when stuck behind an unforgiving firewall
and it has worked for me.

Like I said though, this is NOT the preferred way, just A  way...

HTH,

Brent


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

Date: 22 Jun 1998 13:27:35 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: writing a mud in perl
Message-Id: <6mlm47$es2$1@info.uah.edu>

In article <6mk6ae$hm6$1@nnrp1.dejanews.com>,
	HalloweenJack@my-dejanews.com writes:
: I'm considering writing a mud in perl (along with a few friends). I'm aware
: that on already exists (PerlMUD), but we kind of want to write our own from
: scratch.

>From scratch is rarely fun.  If you don't like Boutell's PerlMUD (or its
terms of distribution), have a look at

    <URL:http://www.cs.uah.edu/~gbacon/perl/pserv/>

It's virgin source in terms of having any MUDdy code (it's strictly
social), but lots of the unfun stuff is in.

Greg
-- 
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 2932
**************************************

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