[16351] in Perl-Users-Digest
Perl-Users Digest, Issue: 3763 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 21 00:05:29 2000
Date: Thu, 20 Jul 2000 21:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <964152310-v9-i3763@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 20 Jul 2000 Volume: 9 Number: 3763
Today's topics:
Re: "Missing coprocessor" <bart.lateur@skynet.be>
Re: "Missing coprocessor" (Keith Calvert Ivey)
Re: $query->can() and cgi.pm (Neil Kandalgaonkar)
alt.perl ?? <wally@deja.com>
Re: alt.perl ?? <tony_curtis32@yahoo.com>
Re: Authenticating on NT Domains (Mark P.)
Re: Check string for a certain format (Keith Calvert Ivey)
Re: Check string for a certain format <care227@attglobal.net>
Re: crypt for Perl 4.0 (Martin Vorlaender)
Do I have this right, now? Please Help! <whataman@home.com>
Re: Do I have this right, now? Please Help! <care227@attglobal.net>
How to delete a record in a text data file? <snakeman@kc.rr.com>
Re: How to delete a record in a text data file? <care227@attglobal.net>
Re: Installing BerkeleyDB on RedHat 6 (Mark P.)
Re: Matts Script Archive - A critique <godzilla@stomp.stomp.tokyo>
Re: MySQL+Apache+PHP+mod_perl+mod_ssl - Is it possible? <tech@phost.net>
Re: MySQL+Apache+PHP+mod_perl+mod_ssl - Is it possible? (brian d foy)
Re: Newbie Question <care227@attglobal.net>
Perl newbie requests help with CGI/Perl <eng80956@nus.edu.sg>
Perl newbie requests help with CGI/Perl <eng80956@nus.edu.sg>
Re: perl-5.6.0: Bug with "not" operator? (Keith Calvert Ivey)
Re: Please help with my 1st attempt <care227@attglobal.net>
Really Newbie Question, ref: sendmail <digitali@systemmedics.com>
Re: Really Newbie Question, ref: sendmail <kloomis@bigplanet.com>
Re: Really Newbie Question, ref: sendmail <mauldin@netstorm.net>
Re: Recursive subroutine output to recursive subroutine (Neil Kandalgaonkar)
s/compiled\s+Win32::OLE\s+and\s+Win32::ADO/$net/g && & <clcollie@mindspring.com>
Re: Understanding Perl Idiom (Please Help) <waltman@netaxs.com>
Where can I find more information <nikitta@ica.net>
Re: Why does this reverse() not work??? <bwalton@rochester.rr.com>
Re: Why does this reverse() not work??? <waltman@netaxs.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 21 Jul 2000 01:08:50 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: "Missing coprocessor"
Message-Id: <n68fns4n7i4ksge2a76j95jib4bpclo1pm@4ax.com>
"Ian." wrote:
>JS> <http://www.delorie.com/djgpp/dl/ofc/simtel/v2gnu/perl552b.zip>
>
>Thats the file I collected. When unzipped, over 6Mb of gunge without
>even a mention of a co-processor without which perl.exe wont run.
>
>JS> And read the other requirements in the sundry documents at the same
>JS> site.
>
>Ill have another look in the v2gnu directory.
Do that. I'm pretty sure it's in the DJGPP FAQ. Have you searched the
site of <www.delorie.com>?
>However I cant see
>why someone couldnt just say.."Try xxxxxxxx.xxx" Im still no
>wiser.
Because nobody here uses such an old PC? Heck, I run DJGPP on a 486DX-2,
but that one *has* a coprocessor.
p.s. I've searched that FAQ myself. Here's the link I found:
http://www.delorie.com/djgpp/v2faq/faq11.html
most notably:
http://www.delorie.com/djgpp/v2faq/faq11_1.html
--
Bart.
------------------------------
Date: Fri, 21 Jul 2000 00:47:49 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: "Missing coprocessor"
Message-Id: <39789cf9.1187805@news.newsguy.com>
ian.freedomnet@softhome.net ("Ian.") wrote:
>JS> Hey! You want to get killfiled over this ?
>
>Preferable to being completely ignored. I wouldnt mind so much if
>this was a low volume group but there looks like theres hundreds
>of people here.
And how many of those hundreds do you think are using Perl for
DOS on a 386 machine? There's nothing wrong with being in an
extreme minority, but don't take it personally when few people
know about your issues. It doesn't mean they hate you -- they
just don't have anything to say.
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
(Free at last from the forced spamsig of
Newsfeeds.com, cursed be their name)
------------------------------
Date: Fri, 21 Jul 2000 01:45:01 GMT
From: neil@brevity.org (Neil Kandalgaonkar)
Subject: Re: $query->can() and cgi.pm
Message-Id: <8l89h5$5jk$1@localhost.localdomain>
In article <39776640.52BDC3A2@lbl.gov>, Frank Hanny <fchanny@lbl.gov> wrote:
>"Note that in the interests of execution speed CGI.pm does not use the
>standard Exporter syntax for specifying load symbols."
I'm not sure what they mean by this. It might be related (see below).
>Is this somewhat terse pronouncement the explanation for why can()
>behaves stangely? Are methods generated dynamically in some fashion?
Methods are generated dynamically. CGI.pm relies heavily on AUTOLOAD tricks.
See man perlsub for a brief intro to AUTOLOAD.
As you have found, AUTOLOAD and can() are not good friends.
--
Neil Kandalgaonkar <neil@brevity.org>
------------------------------
Date: Thu, 20 Jul 2000 22:45:40 -0400
From: "Wally" <wally@deja.com>
Subject: alt.perl ??
Message-Id: <8l8d9n$1kg$1@slb6.atl.mindspring.net>
Is there such a newsgroup as alt. perl ?
It doesn't seem to come up in any searches, yet
I've heard people mention it.
------------------------------
Date: 20 Jul 2000 21:45:16 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: alt.perl ??
Message-Id: <877lagjj5v.fsf@limey.hpcc.uh.edu>
>> On Thu, 20 Jul 2000 22:45:40 -0400,
>> "Wally" <wally@deja.com> said:
> Is there such a newsgroup as alt. perl ? It doesn't
> seem to come up in any searches, yet I've heard people
> mention it.
Yes, there is. Didn't you just try subscribing to it?
(Personally I don't think it's much use. Far too much
noise to signal and people USING CAPS ALL OVER THE PLACE.)
hth
t
--
"With $10,000, we'd be millionaires!"
Homer Simpson
------------------------------
Date: Fri, 21 Jul 2000 02:55:41 GMT
From: perl@imchat.com (Mark P.)
Subject: Re: Authenticating on NT Domains
Message-Id: <3977bb6a.387707774@news.ionet.net>
On Thu, 20 Jul 2000 17:44:46 -0400, Dave Fogelson <dfog@home.com>
wrote:
>use AuthenticateUser;
>AuthenticateUser("Domain", "User", "Password");
>
Shouldn't that be
use Win32::AuthenticateUser; # ????
MP
------------------------------
Date: Fri, 21 Jul 2000 01:20:41 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Check string for a certain format
Message-Id: <3979a533.3293418@news.newsguy.com>
Drew Simonis <care227@attglobal.net> wrote:
>$string = 'XX9999999999';
>
>if ($string =~ /^[a-zA-Z]{2}?\d{10}?$/){
What are the question marks for?
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
(Free at last from the forced spamsig of
Newsfeeds.com, cursed be their name)
------------------------------
Date: Thu, 20 Jul 2000 23:12:34 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Check string for a certain format
Message-Id: <3977BFA2.EEF5F203@attglobal.net>
Keith Calvert Ivey wrote:
>
> Drew Simonis <care227@attglobal.net> wrote:
>
> >$string = 'XX9999999999';
> >
> >if ($string =~ /^[a-zA-Z]{2}?\d{10}?$/){
>
> What are the question marks for?
From perlre:
*? Match 0 or more times
+? Match 1 or more times
?? Match 0 or 1 time
{n}? Match exactly n times
{n,}? Match at least n times
{n,m}? Match at least n but not more than m times
I am not the best with regex crap, so I always go by the book.
------------------------------
Date: Fri, 21 Jul 2000 05:28:57 +0200
From: martin@radiogaga.harz.de (Martin Vorlaender)
Subject: Re: crypt for Perl 4.0
Message-Id: <3977c379.524144494f47414741@radiogaga.harz.de>
Bob Walton (bwalton@rochester.rr.com) wrote:
: default wrote:
: > Does Perl v4.0.1.8 have a crypt or something that will encrypt text?
:
: At one time, there was a Crypt module, ... I no
: longer have a copy of the Crypt module, and, apparently, neither does
: CPAN -- after all, crypt is standard in Perl 5.
As someone else mentioned, Gurusamy's Win32 perl 5.004 port didn't have
crypt(). That's why I translated a Java implementation of Eric Young's C
code. You can find it in CPAN as Crypt::UnixCrypt. I've never used Perl 4,
but I doubt it would be too hard to get it to run.
cu,
Martin
--
One OS to rule them all | Martin Vorlaender | VMS & WNT programmer
One OS to find them | work: mv@pdv-systeme.de
One OS to bring them all | http://www.pdv-systeme.de/users/martinv/
And in the Darkness bind them.| home: martin@radiogaga.harz.de
------------------------------
Date: Fri, 21 Jul 2000 02:08:29 GMT
From: "What A Man !" <whataman@home.com>
Subject: Do I have this right, now? Please Help!
Message-Id: <3977B0CF.B85D7BA7@home.com>
Thanks to Larry Rosler and Eric Bohlman who tried to help
me with this coding a week ago. Since that time, being an
amateur at perl, I have researched the FAQ and spent 60-80
hours visiting Perl sites to try and get this right.
However, I still cannot get the below coding to work for a
flocked counter, even after revisions. Would someone
PLEASE fix my code below for me? Thanks. This is driving
me insane!
#!/usr/local/bin/perl -w
use strict;
print "Content-type: text/html\n\n";
sysopen(HITS, "pagehits2.txt", O_RDWR|O_CREAT, 0644) or
die "can't open pagehits2.txt";
flock(HITS, 2) or die "can't flock pagehits2.txt";
$hits = <HITS> || 0;
seek(HITS, 0, 0) or die "can't rewind pagehits2.txt";
truncate(HITS, 0) or die "can't truncate pagehits2.txt";
++$hits;
(print HITS $hits) or die "can't write pagehits2.txt";
1 while $hits =~ s/(.*\d)(\d\d\d)/$1,$2/;
$hits =~ s/(1[123]|[4-90]$)/$1th/;
$hits =~ s/(1$)/$1st/;
$hits =~ s/(2$)/$1nd/;
$hits =~ s/(3$)/$1rd/;
print <<HTML;
<html><body><head><title>counter</title></head><body>"You
are the $hits visitor to this page"<BR></body></html>"
HTML;
close(HITS);
##END
Regards,
Dennis
------------------------------
Date: Thu, 20 Jul 2000 23:24:59 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Do I have this right, now? Please Help!
Message-Id: <3977C28B.27010188@attglobal.net>
"What A Man !" wrote:
>
> Thanks to Larry Rosler and Eric Bohlman who tried to help
> me with this coding a week ago. Since that time, being an
> amateur at perl, I have researched the FAQ and spent 60-80
> hours visiting Perl sites to try and get this right.
> However, I still cannot get the below coding to work for a
> flocked counter, even after revisions. Would someone
> PLEASE fix my code below for me? Thanks. This is driving
> me insane!
What error are you seeing? Can't help if I don't know what to look
for. (don't worry, there are those among us who can, I'm just not
there yet =)
>
> #!/usr/local/bin/perl -w
> use strict;
> print "Content-type: text/html\n\n";
> sysopen(HITS, "pagehits2.txt", O_RDWR|O_CREAT, 0644) or
> die "can't open pagehits2.txt";
Checking for failure on an open is a Good Thing, but don't you
want to know why it fails if it does? Checking the value of $!
will show you. Like:
die "can't open pagehits2.txt: $!";
> flock(HITS, 2) or die "can't flock pagehits2.txt";
> $hits = <HITS> || 0;
why the or here? if HITS didn't open, your script die's.
> seek(HITS, 0, 0) or die "can't rewind pagehits2.txt";
> truncate(HITS, 0) or die "can't truncate pagehits2.txt";
> ++$hits;
> (print HITS $hits) or die "can't write pagehits2.txt";
I've never seen a print to an open filehandle fail. I think you've
gone die() crazy!
> 1 while $hits =~ s/(.*\d)(\d\d\d)/$1,$2/;
Why the while statment here? What is it intended to accomplish?
> $hits =~ s/(1[123]|[4-90]$)/$1th/;
> $hits =~ s/(1$)/$1st/;
> $hits =~ s/(2$)/$1nd/;
> $hits =~ s/(3$)/$1rd/;
> print <<HTML;
> <html><body><head><title>counter</title></head><body>"You
> are the $hits visitor to this page"<BR></body></html>"
> HTML;
> close(HITS);
secret: many of the functions don't require parens. Generally, the
rule is to only use parens when not using them would lead to confusion,
nesting functions, for example. Neither open() or close() require
parens. Does sysopen? try it and find out!
------------------------------
Date: Fri, 21 Jul 2000 02:54:38 GMT
From: "DS" <snakeman@kc.rr.com>
Subject: How to delete a record in a text data file?
Message-Id: <OXOd5.5288$t%4.64242@typhoon.kc.rr.com>
How could I delete a record in a text data file if each record was separated
by a ^ ? I currently use a pipe (|) to separate the record's field ? Is
there a good tutorial on writing to files for perl?
Thanx
DS
------------------------------
Date: Thu, 20 Jul 2000 23:14:24 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: How to delete a record in a text data file?
Message-Id: <3977C010.8B1B2F2F@attglobal.net>
DS wrote:
>
> How could I delete a record in a text data file if each record was separated
> by a ^ ? I currently use a pipe (|) to separate the record's field ? Is
> there a good tutorial on writing to files for perl?
>
> Thanx
> DS
This one is in the FAQ. I won't tell you which one, so you'll have
to read them all =)
www.perl.com has them in a friendly, HTMLish way.
------------------------------
Date: Fri, 21 Jul 2000 03:10:15 GMT
From: perl@imchat.com (Mark P.)
Subject: Re: Installing BerkeleyDB on RedHat 6
Message-Id: <3977bd91.388258045@news.ionet.net>
On Thu, 20 Jul 2000 12:09:55 GMT, hagayd@my-deja.com wrote:
>Hi,
>
>We were using BerkeleyDB.pm to communicate with Berkeley dB. It worked
>fine on the Solaris OS. Then we wrote a time consuming script that
>needed to run in parallel on a Linux cluster. When we have tried to
>install it we encounter a problem that described in the CPAN
>documentation :
>
>Linux Notes
> -----------
>
> Newer versions of Linux (e.g. RedHat 6) ship with a C library that has
> a version of Berkeley DB linked into it. This makes it very difficult
>to
> build DB_File with anything other than the version of Berkeley DB that
> shipped with your Linux release. If you do try to use a different
> version of Berkeley DB you will probably get the error described in the
> "Incompatible versions of db.h and libdb" section of this file.
>
> As yet I haven't found a satisfactory way around this problem. If you
> do know a workaround to this problem which doesn't involve replacing
> the built in version of Berkeley DB I would like to hear from you.
>
I'm running BerkeleyDB on RedHat 6.01. I downloaded the latest
version from sleepycat, not the RPM, and it installed fine. DB_File
installed fine along with MLDBM, but BerkeleyDB.pm refused to install.
Since I really didn't need anything more than DB_File and MLDBM then I
just discounted it, although I did bring it to the attention of
Sleepycat.
FWIW, this needs to be brought to the attention of the
programmer of BerkeleyDB.pm.
MP
------------------------------
Date: Thu, 20 Jul 2000 18:21:27 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Matts Script Archive - A critique
Message-Id: <3977A597.A643800F@stomp.stomp.tokyo>
Greg Andrews wrote:
> Godzilla! wrote:
> >Richard Lawrence wrote:
(notices a skip loader bucket of fresh mule manure being dumped)
I'll get back to you on your thoughts. There
is a dire need for me to slip on my gator waders.
I'm wearing my new tennis shoes, you understand.
Godzilla!
--
$godzilla = "godzilla rocks!";
srand(time() ^ ($$ + ($$ << 15)));
sub randcase
{ rand(40) < 20 ? "\u$1" : "\l$1" ; }
$godzilla =~ s/([a-z])/randcase($1)/gie;
print $godzilla; exit;
------------------------------
Date: Fri, 21 Jul 2000 02:05:22 GMT
From: Permanent Hosting Networks <tech@phost.net>
Subject: Re: MySQL+Apache+PHP+mod_perl+mod_ssl - Is it possible??
Message-Id: <39765E49.4C6C9DA@phost.net>
I haven't yet talked to anyone thats done it successfully.
I sure couldn't i spent 4 days on it thinking i was just an idiot i gave up..
maybe someone should contact each of the people mantaining each of these apps.
they should be able to work out quickly whats screwing up... hopefully.
i beleive it has something to do with mod_perl completely hating apache with
dso but not sure..
--
Mitchell W. Shier
Network Systems Admin
Permanent Hosting Networks http://www.phost.net
101-111 Waterloo St.
London, ON Canada
Greg wrote:
> "Nicholas A. Kuzmik" wrote:
> >
> > In article <8l03b1$ho9$1@nnrp1.deja.com>, vartekquest@my-deja.com wrote:
> >
> > >
> > >
> > > I want to setup a Linux www server with support for PHP + mod_perl +
> > > SSL, but I haven't been able to compile it succesfully.
> > >
> > > - Firstly I install mySQL
> > > - then I build PHP
> > > - then I patch apache with mod_ssl
> > > - then I patch apache with mod_perl
> > > - from mod_perl I do: make; make install, but it doesn't compile.
> > > - then I should change httpd.conf to add support for .php, .php3,
> > > etc. et voila!
> > >
> > > The question is: is it possible to share both PHP, mod_perl and
> > > mod_ssl built on an Apache server? Or is it just plain stupid compiling
> > > mod_perl when you have PHP?
> > >
> > > Has anybody successfully built this config?
> > >
> > >
> > > Sent via Deja.com http://www.deja.com/ Before you buy.
> >
> > what about php4? if mod_perl is enabled (either by DSO or by built-in), i
> > get a nasty segfault == document contained no data. bleh...
> >
> > nick kuzmik
>
> I tried to do the same once a while back and after 8-10 hours of trying
> I gave up.
> I'd be interested to know if you ever get them all to work.
------------------------------
Date: Thu, 20 Jul 2000 23:34:48 -0500
From: brian@smithrenaud.com (brian d foy)
Subject: Re: MySQL+Apache+PHP+mod_perl+mod_ssl - Is it possible??
Message-Id: <brian-2007002334490001@180.sanjose-08-09rs16rt.ca.dial-access.att.net>
In article <39765E49.4C6C9DA@phost.net>, Permanent Hosting Networks <tech@phost.net> wrote:
>I haven't yet talked to anyone thats done it successfully.
now you have.
>i beleive it has something to do with mod_perl completely hating apache with
>dso but not sure..
don't use DSO, which is of questionable value anyway. perhaps that is
your problem.
--
brian d foy
Perl Mongers <URI:http://www.perl.org>
CGI MetaFAQ
<URI:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Thu, 20 Jul 2000 23:07:23 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Newbie Question
Message-Id: <3977BE6B.6C4DD95F@attglobal.net>
Marcus Ouimet wrote:
>
> I am editing a script but I want to have it do the following. Right now it
> searches all 3 things and that is fine and dandy. I am trying to add a
> $hiddencity variable which will come from the city input box. ie there is an
> input box to put the city in which sends the city to the script. I want it
> to search the city and hiddencity field for a word. I hope this makes sense.
> Any direction appreciated.
>
> if( (($in{city} eq "") || ($city =~ /$in{city}/i)) &&
> (($in{country} eq "NS") || ($country =~ /$in{country}/i)) &&
> (($in{state} eq "") || ($in{state} eq "NS") || ($in{state} eq
> $state)) ) {
> $x++;
Give up your worship of the Cargo Cult and stop using these hackish
means of gathering form input.
use CGI;
Be safe.
------------------------------
Date: Fri, 21 Jul 2000 11:15:01 +0800
From: Murlimanohar Ravi <eng80956@nus.edu.sg>
Subject: Perl newbie requests help with CGI/Perl
Message-Id: <22E71DAEC504D111B78100805FFE9DC73BDFD7C5@pfs21.ex.nus.edu.sg>
Hi,
I am new to Perl programming tho I am somewhat familiar with some other
languages. I have been trying to run a very basic CGI script without
success.
Murli.
------------------------------
Date: Fri, 21 Jul 2000 11:28:05 +0800
From: Murlimanohar Ravi <eng80956@nus.edu.sg>
Subject: Perl newbie requests help with CGI/Perl
Message-Id: <22E71DAEC504D111B78100805FFE9DC73BDFF9E6@pfs21.ex.nus.edu.sg>
Sorry my computer froze before I could complete my post. Here it is
again.
Hi,
I am new to Perl programming tho I am somewhat familiar with some other
languages. I have been trying to run a very basic CGI script without
success. It goes sthg like this:
#! /usr/contrib/bin/perl
print "Content-type: text/html\n\n";
print <<'FINISHED';
<HTML>
<HEAD>
<TITLE>
Does this work?
</TITLE>
</HEAD>
<BODY>
Hello
</BODY>
</HTML>
FINISHED
The HTML file calling this is:
<HTML>
<HEAD>
<TITLE>
Test page for Perl
</TITLE>
</HEAD>
<BODY>
<FORM METHOD = "GET" ACTION = "test.pl">
<INPUT TYPE = "SUBMIT">
</FORM>
</BODY>
</HTML>
For some reason, when I click the Submit button, the browser only
displays the source of the Perl file not the desired HTML output. How
should I resolve this?
I have tried running this on an HP UNIX workstation with Netscape and
also on Win98 with IE. Neither computer is configured as a server so
could that be a problem?
Any help will be greatly appreciated. Thanks.
Murli.
------------------------------
Date: Fri, 21 Jul 2000 00:37:08 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: perl-5.6.0: Bug with "not" operator?
Message-Id: <39779a50.506430@news.newsguy.com>
i_am_leo@my-deja.com wrote:
>However, I still don't like the new behaviour of "not".
Can you give an example of an expression you'd use in a real
program where the changed behavior makes a difference and where
you prefer the old behavior? I find it hard to imagine that
someone would use "not($a) and $b" to mean "not($a and $b)".
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
(Free at last from the forced spamsig of
Newsfeeds.com, cursed be their name)
------------------------------
Date: Thu, 20 Jul 2000 23:26:26 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Please help with my 1st attempt
Message-Id: <3977C2E2.FA6B20E4@attglobal.net>
Rick wrote:
>
> Hello,
>
> I am trying to excute my first perl script and am getting the error "CGIwrap
> Error: User not found in passwd file." I have the permissions set to 751
>
> Any help would be greatly appreciated.
Talk to your seemingly paranoid sysadmin. Seems s/he has a wrapper
around CGI scripts, or maybe just Perl, that checks before allowing
execution.
Just my guess.
------------------------------
Date: Thu, 20 Jul 2000 21:10:15 -0500
From: Digitali Binar <digitali@systemmedics.com>
Subject: Really Newbie Question, ref: sendmail
Message-Id: <57cfns0th1p483ksm7kc2susm5fap9qv3k@4ax.com>
I'm currently getting my feet wet with Perl on BSD.
I'm trying to run a simple sendmail script and keep getting the same
error message:
Unquoted string "sendmail" may clash with future reserved word at
sendtest.pl line 8
Same thing for lines 9-12 as well. At the end it tells me that it had
compilation errors.
The source code follows:
__________________________
#!/usr/home/howardsc/usr/bin/perl
$email_from="digitali\@howardschoice.com";
$email_to="digitali\@systemmedics.com";
$email_subject="Mail Test";
$email_body="Test successful!";
print sendmail "From: $email_from\n";
print sendmail "To: $email_to\n"
print sendmail "Subject: $email_subj\n\n";
print sendmail $email_body;
close(sendmail)
or warn "sendmail didn't close nicely";
exit(0);
_________________________
The sendmail module is located in my /bin directory.
Any idea what I'm doing wrong? The throbbing in my temple quickens.
Thanks.
dB
------------------------------
Date: Thu, 20 Jul 2000 19:46:47 -0700
From: Ken Loomis <kloomis@bigplanet.com>
Subject: Re: Really Newbie Question, ref: sendmail
Message-Id: <3977B997.75CF583E@bigplanet.com>
This is a multi-part message in MIME format.
--------------8277D566B53F536120FADBBD
Content-Type: text/plain; charset=us-ascii; x-mac-type="54455854"; x-mac-creator="4D4F5353"
Content-Transfer-Encoding: 7bit
I'm a newbie also, but I'll venture a solution here.
The sendmail program has to be opened before printing to it.
Try adding:
$mailprog = '/bin/sendmail';
The open for printing with:
open (MAIL, "|$mailprog -t");
Change your print lines to look like this:
print MAIL "From: $email_from\n";
I'm not sure what the '|' or the '-t' are for in the open statement, but
I got it from an example script and it has always worked for me.
Hope this helps,
Ken Loomis
Digitali Binar wrote:
> I'm currently getting my feet wet with Perl on BSD.
> I'm trying to run a simple sendmail script and keep getting the same
> error message:
>
> Unquoted string "sendmail" may clash with future reserved word at
> sendtest.pl line 8
>
> Same thing for lines 9-12 as well. At the end it tells me that it had
> compilation errors.
>
> The source code follows:
> __________________________
> #!/usr/home/howardsc/usr/bin/perl
>
> $email_from="digitali\@howardschoice.com";
> $email_to="digitali\@systemmedics.com";
> $email_subject="Mail Test";
> $email_body="Test successful!";
>
> print sendmail "From: $email_from\n";
> print sendmail "To: $email_to\n"
> print sendmail "Subject: $email_subj\n\n";
> print sendmail $email_body;
> close(sendmail)
> or warn "sendmail didn't close nicely";
>
> exit(0);
> _________________________
>
> The sendmail module is located in my /bin directory.
>
> Any idea what I'm doing wrong? The throbbing in my temple quickens.
> Thanks.
>
> dB
--------------8277D566B53F536120FADBBD
Content-Type: text/x-vcard; charset=us-ascii;
name="kloomis.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Ken Loomis
Content-Disposition: attachment;
filename="kloomis.vcf"
begin:vcard
n:Loomis;Ken
tel;pager:888-423-8493
tel;fax:603-299-4785
tel;work:619-232-6919
x-mozilla-html:TRUE
url:http://www.KenLoomis.com/
org:Loomis Technology Group
adr:;;302 Island Avenue, Suite 201;San Diego;CA;92101;USA
version:2.1
email;internet:kloomis@bigplanet.com
title:Director
x-mozilla-cpt:;3
fn:Ken Loomis
end:vcard
--------------8277D566B53F536120FADBBD--
------------------------------
Date: Fri, 21 Jul 2000 02:59:33 GMT
From: Jim Mauldin <mauldin@netstorm.net>
Subject: Re: Really Newbie Question, ref: sendmail
Message-Id: <3977BBC6.282E0583@netstorm.net>
Digitali Binar wrote:
>
> I'm trying to run a simple sendmail script and keep getting the same
> error message:
>
> Unquoted string "sendmail" may clash with future reserved word at
> sendtest.pl line 8
perldoc perldiag
Scroll down to the warning to see what that's about. In any case,
filehandles are traditionally capitalized as a way of saving you from
yourself.
> At the end it tells me that it had compilation errors.
<snip>
Here's the line that's the source of the compilation error:
> print sendmail "To: $email_to\n"
See anything wrong? perl is trying to help you, if you'll let it.
Plus, I don't see an open for sendmail, so you'll get a runtime error.
-- Jim
------------------------------
Date: Fri, 21 Jul 2000 02:07:31 GMT
From: neil@brevity.org (Neil Kandalgaonkar)
Subject: Re: Recursive subroutine output to recursive subroutine problem
Message-Id: <8l8ar9$5n8$1@localhost.localdomain>
In article <40BE1E900985F3A4.A8CC1CEC9929BE94.30DE00F808D376AA@lp.airnews.net>,
<firstname.lastname@nokia.com> wrote:
> When the second subregion processes it it now contains
>information from the first time plus this second time. I want to have
>the second subregion flush its information before the next element is
>passed to it and only deals with that current information.
Sounds like you should be using lexical variables. Except for special cases,
local() has been deprecated since kids in kindergarten were born. You use
local scrupulously, so just change those to my().
Your code excerpt is way, way too long to critique, and you have not
even pointed out where the problem is.
I assume you have been learning from some lame, outdated book, so consider
getting a better one.
http://language.perl.com/critiques/index.html (old, but good.)
http://www.pobox.com/~schwern/reviews/books/perl/
(most offensive perl books cheerfully trashed).
Since you're new to programming, look into Beginning Perl from Wrox...
this is just out, but I expect great things from Simon Cozens.
--
Neil Kandalgaonkar <neil@brevity.org>
------------------------------
Date: Thu, 20 Jul 2000 23:16:45 -0400
From: "clayton collie" <clcollie@mindspring.com>
Subject: s/compiled\s+Win32::OLE\s+and\s+Win32::ADO/$net/g && &email( $me, $url )
Message-Id: <8l8f2q$vbc$1@slb7.atl.mindspring.net>
excuse the syntactically incorrect attempt at humour, but im trying to find
compiled versions of Win32::OLE and Win32::ADO (i can only compile C on my
Linux partition for the moment). ive checked the usual places (CPAN,
ActiveState).
cc
------------------------------
Date: 20 Jul 2000 22:40:53 -0400
From: Walt Mankowski <waltman@netaxs.com>
Subject: Re: Understanding Perl Idiom (Please Help)
Message-Id: <m3d7k86w96.fsf@netaxs.com>
kenlaird@my-deja.com writes:
> I've got this script:
>
> #!/usr/bin/perl -w
> @a=`ps -edf`;
> foreach (@a) {
> if (/ftp/) {
> print ;
> }
> }
>
>
> It works fine,but trying to understand the Perl idiom I'd like to
> know why the use of both parenthesis (without them it doesn't work ).
> Would be grateful to have any explanation.
This is discussed in perlsyn, under the "Simple Statements" section.
Enter "perldoc perlsyn" to read it.
Walt
------------------------------
Date: Thu, 20 Jul 2000 23:27:28 -0700
From: nikita <nikitta@ica.net>
Subject: Where can I find more information
Message-Id: <3977ED50.D6FF4C41@ica.net>
Hello
Where can I find more information about Perl programming,
exactly
****Reading N consecutive rows from an arbitrary starting point, and
finishing.*******
Thanks in advance
Serguei
------------------------------
Date: Fri, 21 Jul 2000 02:33:11 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Why does this reverse() not work???
Message-Id: <3977B6A5.BD64D666@rochester.rr.com>
rhys wrote:
>
> You may recognise this as an example from Learning Perl. The reverse()
> refuses to operate for me (running RedHat 6.2, kernel-2.2.14-6.1.1,
> perl-5.00503-10).
>
> #!/usr/bin/perl -w
>
> print "Enter the list of strings \n";
> @list = <STDIN>;
>
> @reversed = reverse(@list);
>
> print @reversed;
Hmmmm...it works for me, verbatim as above. Perl 5.6, ActiveState build
615, Windoze 98 SE. What exactly "refuses to operate"? You're not
expecting the strings to get reversed when reverse is called in list
context, are you? In list contect, reverse reverses the argument list,
and does not stringify and reverse the elements of the list.
perldoc -f reverse
--
Bob Walton
------------------------------
Date: 20 Jul 2000 22:17:43 -0400
From: Walt Mankowski <waltman@netaxs.com>
Subject: Re: Why does this reverse() not work???
Message-Id: <m3g0p46xbs.fsf@netaxs.com>
rhys <rhys.tucker@dtn.ntl.com> writes:
> You may recognise this as an example from Learning Perl. The reverse()
> refuses to operate for me (running RedHat 6.2, kernel-2.2.14-6.1.1,
> perl-5.00503-10).
>
> #!/usr/bin/perl -w
>
> print "Enter the list of strings \n";
> @list = <STDIN>;
>
> @reversed = reverse(@list);
>
> print @reversed;
When you use <> in list context, it stores each line as a separate
entry in the list. So if you enter
1 2 3 4
you just get back
1 2 3 4
because @list only has one element in it. If, however, you put them
each on their own line:
1
2
3
4
then @list has 4 elements in it, and you get back
4
3
2
1
Walt
------------------------------
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 3763
**************************************