[8586] in Perl-Users-Digest
Perl-Users Digest, Issue: 2203 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Mar 29 07:07:16 1998
Date: Sun, 29 Mar 98 04:00:27 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 29 Mar 1998 Volume: 8 Number: 2203
Today's topics:
Re: CGI - Multiple values in an associative array (Tom Mornini)
Datagram problem <nospam@nospam.com>
Re: filtering disruptive characters in win32 <rjk@coos.dartmouth.edu>
Re: filtering disruptive characters in win32 <rootbeer@teleport.com>
Re: HELP - Perl 5 on NT Server 4.0 and IIS <dman@accessone.com>
Re: Is there a "Newsgroup" for Newbies to Perl? <gwynne@utkux.utk.edu>
Re: Null Strings vs. 0 Integer Values <rjk@coos.dartmouth.edu>
Re: Null Strings vs. 0 Integer Values <rootbeer@teleport.com>
Re: Odd-Numbered Array to Hash <rjk@coos.dartmouth.edu>
Re: Perl Cgi Questions <rootbeer@teleport.com>
PerlScript & VBScript & IIS 3.0 <rchavez@beansprout.net>
pooling db connections (asdf)
Re: pooling db connections (brian d foy)
Re: readkey(???) <bholzman@mail.earthlink.net>
Re: readkey(???) <rootbeer@teleport.com>
Showing Automatic File Statistics with a Hyperlink <jvargas@vargastudios.com>
Re: SUID for scripts; system(), et al. <rootbeer@teleport.com>
Re: Sysadmin struggeling with PERL/Sed and etc... <rjk@coos.dartmouth.edu>
Use Perl to update Monolith server (Adam)
Re: verifying email address -- how? (I R A Aggie)
Re: verifying email address -- how? <rjk@coos.dartmouth.edu>
Re: What does -f do? <rjk@coos.dartmouth.edu>
Re: What does this one liner do? <rjk@coos.dartmouth.edu>
Re: What does this one liner do? <scribble@pobox.com>
Re: What does this one liner do? <rootbeer@teleport.com>
Win32::OLE and Word97 (Paul.Casteels)
Re: WinAT Scheduling of perl scripts <agruskin@melbpc.org.au>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 29 Mar 1998 07:53:37 GMT
From: tmornini@netcom.com (Tom Mornini)
Subject: Re: CGI - Multiple values in an associative array
Message-Id: <tmorniniEqKLxD.Ip0@netcom.com>
Tom Phoenix (rootbeer@teleport.com) wrote:
: Associative array - We call them "hashes" now.
A rose, by any other name...
: > - but what kind of strain does that put on the server?
: Perl doesn't care. :-) But you could ask in a newsgroup about servers, if
: that's what you need.
This is a really assinine response to this question.
: Good luck!
Do you really mean that? I remember when this newsgroup was really an
amazing resource. While I freely admit that there are far too many
posts here from persons who obviously haven't read the docs thorougly,
I'll also say that I think many of the regulars are starting to sound
like a bunch of sniveling, whining jerks that are more interested in
their status as gurus than helping along those below them.
-- Tom Mornini
-- InfoMania
------------------------------
Date: Sun, 29 Mar 1998 18:35:00 +0800
From: JY <nospam@nospam.com>
Subject: Datagram problem
Message-Id: <351E23D4.361@nospam.com>
I'd need help with the following : I'd need a Perl script that sends a
datagram (via UDP) to a Java applet server. The Java applet would beep
when it gets the datagram and also display it's contents.
Thank you very much in advance for your help.
Jean-Yves Sireau Email : jys @
Hong Kong hk.super.net
------------------------------
Date: Sun, 29 Mar 1998 01:05:27 -0500
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
To: Leah Norman <nix@cyberramp.net>
Subject: Re: filtering disruptive characters in win32
Message-Id: <351DE4AB.97255F4B@coos.dartmouth.edu>
[posted and mailed]
Leah Norman wrote:
>
> I am using Perl for Win32. I am processing data files that are mostly text
> but have hex 1A (EOF?) characters scattered throughout. I have found that
> if I open the file in binmode, use s/\x1A//g on each buffer load, and save
> the whole thing to a temp file, I can then process the temp file as normal
> text. Otherwise, the line processing will end at the first x1A
> encountered.
Couldn't you just open the file in binmode() in your original program?
(You'll just need to be careful about the line endings; in text mode, "\r\n"
would be changed to "\n" on input and back to "\r\n" on output. But you could
use binmode() and do that manually.)
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J. Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Sun, 29 Mar 1998 03:03:50 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Leah Norman <nix@cyberramp.net>
Subject: Re: filtering disruptive characters in win32
Message-Id: <Pine.GSO.3.96.980329025742.3818N-100000@user2.teleport.com>
On 28 Mar 1998, Leah Norman wrote:
> I am using Perl for Win32. I am processing data files that are mostly
> text but have hex 1A (EOF?) characters scattered throughout. I have
> found that if I open the file in binmode, use s/\x1A//g on each buffer
> load, and save the whole thing to a temp file, I can then process the
> temp file as normal text. Otherwise, the line processing will end at
> the first x1A encountered.
>
> There's got to be a better way to do this ( hopefully not involving a
> temp file). Any suggestions?
Well, you could fix the files so that they're proper text files! :-)
But maybe that's not what you want. I'd probably process it as I read it,
maybe something like this. Does this method work for you? (I don't have a
DOS/Windows machine to test this on, but I believe it should work.)
open FILE, $name or die "Can't open '$name' for input: $!";
binmode FILE;
while (<FILE>) {
tr/\x1A//d; # Strip unwanted \x1A chars
chomp; # optional
# your code here
}
Note that I've used tr///d instead of s///g; this should be faster and
more efficient, although probably not enough to notice.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 28 Mar 1998 22:38:24 -0800
From: "dman" <dman@accessone.com>
Subject: Re: HELP - Perl 5 on NT Server 4.0 and IIS
Message-Id: <6fkqgi$e6g$1@usenet11.supernews.com>
It all depend on the Web Server your using.
if you're using O'Reilly's (I believe that close enough on the spelling)
it usually does. I use omni web server, and I do get my scripts across
without timing out.
Also I do agree with you, I'll take UNIX anytime
dman
Rick Edwards wrote in message <351CA202.C17DFB16@sk.sympatico.ca>...
>Man, give me UNIX anyday. I have PERL installed in c:\perl, I have
>".pl" associated with c:\perl\bin\perl.exe, I made the change in my
>Registry, I have an Application mapping in my Web Site properties, my
>cgi-bin directory has "Script" permissions, and my tongue is in the
>proper position, out the left side of my mouth.
>
>My scripts work *fine* from the command line, but when I try to access
>them with the browser, NADA. They eventually just time out - no
>errors, just timeout.
>
>I'm sure that it's *just* a configuration gotcha, but danged if I can
>find it.
>
>Any ideas out there??
>
>TIA,
>Rick
>ricke@sk.sympatico.ca
>
------------------------------
Date: Sat, 28 Mar 1998 23:46:46 -0500
From: "Bob Gwynne" <gwynne@utkux.utk.edu>
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <6fkjo1$bbl$1@gaia.ns.utk.edu>
I thought that programmers were suppose to be logical thinkers. If
non-programmers should not "use" any programming language, how can they
learn a programming language without using one? Why did you co-author
Learning Perl--just for the money? For leisure reading by those who already
know how to program in Perl? Or did you write it to teach people how to use
the language. The arrogance of some of the "professional" programmers in
this newsgroup is appalling. And, your answer is the most appalling.
Whereas you should be encouraging people to learn Perl (at the very least so
that they buy your books), your answer is designed to drive them away. If
learning Perl is guaranteed to make me into an elitist maybe I should mail
you the books you wrote and have you mail me my money back--before I sell my
soul to the devil.
Get off it! Try to help people who want to learn to program. You are
obviously not a professional teacher; therefore, you should not attempt to
teach by writing, by advising newbies, or by conducting workshops and
classes. Stick to programming if you are a programmer.
Bob Gwynne
Tom Christiansen wrote in message <6f5fm2$lr4>
>Nonprogammers should not use any programming language. Period.
>Nonsurgeons should perform any surgical interventions. Period.
What??? You don't mean that!!
This is
>a profession, you know. If you aren't a programmer, hire one.
Sure, on a professor's salary yet!
>
>"C/Java/C++/Perl for Non-programmers" is oxymoronic.
>
>--tom
>--
> Tom Christiansen tchrist@jhereg.perl.com
>
> "I think the pod should be the master...."
> --Larry Wall in <9410072305.AA03994@scalpel.netlabs.com>
------------------------------
Date: Sun, 29 Mar 1998 00:18:18 -0500
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: Null Strings vs. 0 Integer Values
Message-Id: <351DD99C.2CA6B622@coos.dartmouth.edu>
For the sake of comparison:
| undef '' '0' 'foo'
----------+-------------------------------
defined | '' 1 1 1
length | 0 0 1 3
$_ ne '' | '' '' 1 1
$_ != 0 | '' '' '' 1
$_ | undef '' '0' 'foo'
Notes:
length and $_ ne '' are equivalent in boolean context
$_ != 0 and $_ are equivalent in boolean context
undef yields false in all cases, 'foo' yields true in all cases
if $_ is undef, length, $_ ne '', and $_ != 0 print warnings under -w
($_ will too in some contexts)
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J. Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Sun, 29 Mar 1998 03:23:53 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: Null Strings vs. 0 Integer Values
Message-Id: <Pine.GSO.3.96.980329030719.3818O-100000@user2.teleport.com>
On Sun, 29 Mar 1998, Ronald J Kimball wrote:
> For the sake of comparison:
>
> | undef '' '0' 'foo'
> ----------+-------------------------------
> defined | '' 1 1 1
> length | 0 0 1 3
> $_ ne '' | '' '' 1 1
> $_ != 0 | '' '' '' 1
> $_ | undef '' '0' 'foo'
Maybe I'm misreading this chart, but I think that the "$_ != 0" line might
be incorrect. I think it should say this:
$_ != 0 | '' '' '' ''
That is, none of those four is numerically other than zero.
> $_ != 0 and $_ are equivalent in boolean context
No, they're not. The latter is true whenever it's anything but undef, 0,
'0', or ''. The former is true whenever $_ is numerically non-zero. For
example, "foo" is true in a boolean context, but in a numeric context it's
zero. (And a warnable offense, of course.)
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 28 Mar 1998 23:55:48 -0500
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: Odd-Numbered Array to Hash
Message-Id: <351DD454.54A9403E@coos.dartmouth.edu>
I have a life, and I can prove it! wrote:
>
> >if ($phone eq "") {$phone = "Not Available";}
>
> $phone ||= "Not Available" would probably (usually) work too.
As long as you don't have an entry for the operator. ;-)
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J. Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Sun, 29 Mar 1998 02:20:11 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Mike Glenn <mglenn@no.spam.zbzoom.net>
Subject: Re: Perl Cgi Questions
Message-Id: <Pine.GSO.3.96.980329021255.24340K-100000@user2.teleport.com>
On Sat, 28 Mar 1998, Mike Glenn wrote:
> From: Mike Glenn <mglenn@no.spam.zbzoom.net>
Why do you munge your address, then put it unmunged in your .sig? The
spammers have it now, so there's no point in munging it in the future;
munging inconveniences those who would help you, and it keeps you from
getting the email replies that you may want, but it accomplishes nothing
helpful for anyone. :-(
> Subject: Perl Cgi Questions
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
Also, if these are really CGI questions, they probably belong in a
newsgroup about CGI, rather than one about Perl.
> I have a script that excepts POST data from a TextArea. I would like to
> spell check this data before it is written to file. Does anyone know
> where I can get a Module to do this? I checked CPAN but didn't see
> anything that fit the bill.
Of course, this isn't web-specific; you may want to spell-check any text
from Perl.
If there's not a module for spell-checking, you may need to write one. You
may be able to use a system-level spell checker, if there's one installed
on your system. (Most Unix-type systems have one.) Or, you could make
something out of GNU's spelling program.
> I would also like to parse the above data for web URL's and email
> addresses and then add the aproprate tags. So when the data is rewritten
> on a web page, what I typed is displayed as a link. (Similar to what
> Outlook Express does).
You could use the s/// operator to edit the text, possibly with the /s and
/g options. Is that what you needed? I don't know what Outlook Express
does, so I can't help with that part.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 29 Mar 1998 04:40:46 -0500
From: Ryan Chavez <rchavez@beansprout.net>
Subject: PerlScript & VBScript & IIS 3.0
Message-Id: <351E171E.EFC6318D@beansprout.net>
Folks,
I have installed PerlScript by ActiveState on our server running IIS 3.0
and ASP 1.0b. The PerlScript software appears to write data to the
client just fine. However, when I try passing it variables, or even
fetching the value of a session variable, it returns "error: 80004005"
to the client as well as any commands that did manage to work. Also,
when I tried passing it variables from a VBScript command executed
within a SCRIPT tag, it complains about either a type mismatch error or
type undefined error. I can never get the VBScript command to properly
call a perl subroutine. Can somebody who us currently using PerlScript
PLEASE get to me ASAP? I need the ability to do two somewhat complex
regular expression substitutions on the contents of a textarea. I have
already lost two days on this problem, and need solutions ASAP!!
Thanks,
Ryan Chavez
------------------------------
Date: 29 Mar 1998 08:57:41 GMT
From: you@somehost.somedomain (asdf)
Subject: pooling db connections
Message-Id: <6fl2e5$nj8$1@ultra>
Hello all,
I'm trying to write a perl daemon to pool connections to an Oracle DB, with
the glorious motive of speeding up the cgi scripts needing such connectivity.
I am having limited success getting the daemon to initiate the Oracle
connection and listen on a given port, but am having difficulty getting the
cgi scripts to hook up with the pooled connections.
I'm using the DBI module to handle the Oracle connectivity. I can open the
database, and send raw text to the client, but what I really need to send
is $ora_dbh, the filehandle (?) created here:
my $ora_drh=DBI->install_driver('Oracle') || return 0;
my $ora_dbh=$ora_drh->connect($sid, $uid, $pwd) || return 0;
How do I send this through a socket connection? I suspect that sending a
reference to this variable won't do me any good, as the memory space is
different for the two processes. I think..
Am I on the right track? Does anyone know of some online sample code I could
look up?
Any clues appreciated,
Mike Muldoon
*muldoon*@*freerange*.*com* ..remove *'s for email address
------------------------------
Date: Sun, 29 Mar 1998 04:43:56 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: pooling db connections
Message-Id: <comdog-ya02408000R2903980443560001@news.panix.com>
Keywords: from just another new york perl hacker
In article <6fl2e5$nj8$1@ultra>, you@somehost.somedomain (asdf) posted:
>I'm trying to write a perl daemon to pool connections to an Oracle DB, with
>the glorious motive of speeding up the cgi scripts needing such connectivity.
are you rewriting the modules that already do such a thing? see the
nifty mod_perl stuff along with Lincoln Stein's recent WebTechniques
and Perl Journal articles for details.
good luck :)
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>
------------------------------
Date: Sat, 28 Mar 1998 22:54:28 -0500
From: Benjamin Holzman <bholzman@mail.earthlink.net>
To: beiti@fbg.schwerte.de
Subject: Re: readkey(???)
Message-Id: <351DC5F4.138B3DA9@mail.earthlink.net>
Sebastian,
Check out the Term::ReadKey module from CPAN:
http://www.perl.com/CPAN-local/modules/by-module/Term/TermReadKey-2.12.tar.gz
Sebastian St|we wrote:
>
> Sebastian St|we wrote:
>
> Hi NG !
>
> Can anyone give me a hint about a function named readkey() or sth like
> that ? I'd like to read keys from the keyboard, but print stars on
> screen (enter a pw, sth like that).
>
> Thanks,
>
> Beiti /Sebastian/
> --
> ("`-''-/").___..--''"`-._
> Beiti `6_ 6 ) `-. ( ).`-.__.`)
> beiti@fbg.schwerte.de (_Y_.)' ._ ) `._ `. ``-..-`
> beiti@gmx.net _..`--'_..-_/ /--'_.' ,'
> ___________________________________(il),-'' (li),' ((!.-'
>
> --
> ("`-''-/").___..--''"`-._
> Beiti `6_ 6 ) `-. ( ).`-.__.`)
> beiti@fbg.schwerte.de (_Y_.)' ._ ) `._ `. ``-..-`
> beiti@gmx.net _..`--'_..-_/ /--'_.' ,'
> ___________________________________(il),-'' (li),' ((!.-'
------------------------------
Date: Sun, 29 Mar 1998 01:52:26 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Sebastian St|we <beiti@fbg.schwerte.de>
Subject: Re: readkey(???)
Message-Id: <Pine.GSO.3.96.980329015159.24340F-100000@user2.teleport.com>
On Sat, 28 Mar 1998, Sebastian St=FCwe wrote:
> Can anyone give me a hint about a function named readkey()=20
Sure, here's a hint: There's something like this in the FAQ. :-) Hope
this helps!
--=20
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 28 Mar 1998 23:53:39 -0800
From: John Vargas <jvargas@vargastudios.com>
Subject: Showing Automatic File Statistics with a Hyperlink
Message-Id: <351DFE03.A2F55478@vargastudios.com>
Hello There
I am a Web developer that is in the infancy stages of learning PERL
programming. I have strong experience in HTML and a large base of
experience in graphic design. I'm finding that many employers want Web
developers to have a strong foundation in PERL among other languages.
I'm starting to learn, but I'm sure it'll be some time before I'm half
as savvy as most of you are.
I would like to pose a question and I hope one of you PERL experts would
not feel it too much of an inconvenience to drop me a line. I can be
reached at "jvargas@best.com". Here's my question:
Is there a way with PERL or HTML where you can post statistics for a
particular file, on a Web page. As an example, let's say that I am the
genius that invented and markets PKZIP. I want to make sure that my
downloading customers always know that they are working with the most
current version. No matter when my developers post new builds of PKZIP
to the Web Site, my file link always shows the exact date of posting and
file size right next to the hyperlink. The rub is that I need this text
to be automatically generated where I don't need to rely on my Web page
editors to make the requisite edits to the link.
Can this be done via CGI with a PERL script? Or is there an easier way
to do this with HTML?
Any wisdom you can impart on me would be much appreciated ;-)
Regards
John Vargas
------------------------------
Date: Sun, 29 Mar 1998 01:57:03 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Pat Trainor <ptrainor@bbn.com>
Subject: Re: SUID for scripts; system(), et al.
Message-Id: <Pine.GSO.3.96.980329015351.24340G-100000@user2.teleport.com>
On Sat, 28 Mar 1998, Pat Trainor wrote:
> script to add new users to a system works great as root. I cannot
> get the script to run as SUID root, however without error, this is
> regardless of setting SUID on the script.
>
> Example:
>
> $foo = system("passwd $login");
>
> This line will not work unless the user running the script is
> root.
You probably need to set $< to zero before using system(). Try printing $<
after setting it (or attempting to set it) while debugging your script. If
both $< and $> are zero and that's still not working, let me know.
As with any setid script, though, be very careful with it! :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 29 Mar 1998 01:00:50 -0500
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: Sysadmin struggeling with PERL/Sed and etc...
Message-Id: <351DE396.79288ADD@coos.dartmouth.edu>
David C. McCall wrote:
>
> I've got 2 files each with the same number of lines of text.
> I would like to merge these files line by line *appending the 2nd files
> 1st line to the 1st files 1st line*, and so on....to a 3rd file.....
[my emph]
All of the solutions you've gotten so far have ignored the appending
specification, instead printing one line after another.
Try this instead:
~> cat merge2
#!/usr/local/bin/perl
open(IN1, $in1 = shift) || die "Unable to open $in1: $!\n";
open(IN2, $in2 = shift) || die "Unable to open $in2: $!\n";
while (defined($line1 = <IN1>) and defined($line2 = <IN2>)) {
$line1 =~ tr/\n//d; # ** remove newline from $line1 **
print "$line1$line2";
}
~> merge2 foo bar > baz
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J. Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Sun, 29 Mar 1998 05:37:31 GMT
From: trickett@pacbell.net.nospam (Adam)
Subject: Use Perl to update Monolith server
Message-Id: <6fkmll$i3e$1@nnrp4.snfc21.pbi.net>
Hi,
I have a simple enough problem. I want to schedule a tiny perl script to run,
find my current dynamically allocated IP, and then write the change in the
Monolith server. Using the Socket.pm routine I have easliy identified my IP
address, all I need to know nowm is how to excecute one command:
http://members.ml.
org/mis-bin/ms3/nic/dyndns?
host=<me>&command=Update+Host&do=mod&domain=Fred-2&act=act&ipaddr=<current
IP>&agree=agree
The page uses authorisation, so I need to pass a username and password.
My system is NT, so I can't use a cute Unix style command.....
E-mail suggestions appreciated.
---
Adam <trickett at pacbell dot net>
Unsolicited e-mail will be charged a $10 proof reading
fee - by replying to this posting you are agreeing to
these terms and conditions.
------------------------------
Date: Sat, 28 Mar 1998 23:06:30 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: verifying email address -- how?
Message-Id: <fl_aggie-2803982306300001@aggie.coaps.fsu.edu>
In article <351cc459.117927948@news.xmission.com>, doswald@xmission.com wrote:
+ On 28 Mar 1998 09:07:54 GMT, abigail@fnx.com (Abigail) wrote:
+ >There isn't any. Just because it's (trivially) solvable doesn't mean
+ >there's a regex. Regexes aren't the ultimate solution engine. Regexes are
+ >limited (though 5.005 will make them better). RFC 822 has a grammar.
+ >In BNF. It wouldn't be hard to translate the BNF into a *parser*.
+ >That is, a state machine, with memory, and transitions.
Ok.
+ The fact is that the MRE book attempts to show an email address syntax
+ validity regex, but after creating a regex of over 6000 bytes the
+ author also admits that his concauction still won't permit nested
+ comments within the email address (something that is permissible). He
+ settles for a 6000+ byte regex that will accept one level of comments
+ in the address.
Right. I'm not disagreeing. But will it pass the "fred&barney@stonehenge.com"
test?
But let us drop down to the bottom line, here: what is the cost/benefit
ratio to checking an email address? IMHO, not terribly high. In fact,
its so low as to become a worthless endeavor.
About the only people who would truely benefit from such a thing are
spammers. Except they don't care if their throwaway acount generates
100,000 bounces and turns some poor ISP's server into a smoking crater.
A valid use would be setting up a mailing list. But I suspect the running
and maintenance of such a thing is better served by setting up a proper
list server -- like majordomo.
Perl isn't necessarily the best solution for every problem. This may well
be one of them.
James
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>
------------------------------
Date: Sat, 28 Mar 1998 23:54:05 -0500
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: verifying email address -- how?
Message-Id: <351DD3EE.F0CA314B@coos.dartmouth.edu>
I R A Aggie wrote:
>
> In article <351cc459.117927948@news.xmission.com>, doswald@xmission.com wrote:
>
> + The fact is that the MRE book attempts to show an email address syntax
> + validity regex, but after creating a regex of over 6000 bytes the
> + author also admits that his concauction still won't permit nested
> + comments within the email address (something that is permissible). He
> + settles for a 6000+ byte regex that will accept one level of comments
> + in the address.
>
> Right. I'm not disagreeing. But will it pass the "fred&barney@stonehenge.com"
> test?
Yes. The regex is written according to RFC 822. The only thing it's missing
is nested comments.
http://enterprise.ic.gc.ca/~jfriedl/regex/code.html
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J. Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Sun, 29 Mar 1998 00:47:35 -0500
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: What does -f do?
Message-Id: <351DE07A.701E600B@coos.dartmouth.edu>
Bob Trieger wrote:
>
> Ronald J Kimball wrote:
> >
> > Mike wrote:
> > >
> > > What does -f do?
> >
> > What does reading the documentation do?
>
> Since you ask:
>
> purgatory:$ perldoc -f -f
> No documentation for perl function `f' found
Hehe! :-)
~> perldoc -f -X
=item -X FILEHANDLE
=item -X EXPR
=item -X
A file test, where X is one of the letters listed below. This unary
...
Not entirely obvious, unfortunately.
BTW, the actual output for your command is
No documentation for perl function `-f' found
(It doesn't remove the '-')
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J. Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Sun, 29 Mar 1998 00:27:16 -0500
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: What does this one liner do?
Message-Id: <351DDBB6.B489D75C@coos.dartmouth.edu>
Tushar Samant wrote:
>
> rootbeer@teleport.com writes:
> >On Sat, 28 Mar 1998, Mike wrote:
> >
> >> What does this do? select(undef,undef,undef,0.1);
> >
> >What would you like to know that isn't in the docs?
>
> What the select(2) system call does. What does it *mean* when you say
> any of the bitmasks can be undef. Is sleeping for 0.1 seconds the ONLY
> effect of the call.
Which is, of course, in the documentation for the select(2) system call.
Any of readfds, writefds, and exceptfds may be given as NULL pointers if
no descriptors are of interest.
It means you don't want select to check any file descriptors for that condition.
> Also, what's come over the group.
An inundation of people asking questions clearly answered in the documentation.
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J. Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 29 Mar 1998 01:31:31 -0600
From: Tushar Samant <scribble@pobox.com>
Subject: Re: What does this one liner do?
Message-Id: <6fktcj$8rf@tekka.wwa.com>
rjk@coos.dartmouth.edu writes:
>Tushar Samant wrote:
>>
>> rootbeer@teleport.com writes:
>> >On Sat, 28 Mar 1998, Mike wrote:
>> >
>> >> What does this do? select(undef,undef,undef,0.1);
>> >
>> >What would you like to know that isn't in the docs?
>>
>> What the select(2) system call does. What does it *mean* when you say
>> any of the bitmasks can be undef. Is sleeping for 0.1 seconds the ONLY
>> effect of the call.
>
>Which is, of course, in the documentation for the select(2) system call.
That's not Perl. And what's the first argument there for?
> Any of readfds, writefds, and exceptfds may be given as NULL pointers if
> no descriptors are of interest.
Not in my man page. And what's a null pointer got to do with the undef
value? It seems like the perl documentation is imprecise and points to
non-portable man pages.
>It means you don't want select to check any file descriptors for that
>condition.
I am sure I can reformulate sentences when I see them. But they don't
inform me.
The point, of course, is not whether the piece of info is available
at the end of an easy or difficult scavenger hunt. It's whether it's
REASONABLY available. Actually, I happen to think that the bit about
sleeping for milliseconds IS fairly reasonably available in the perl
man pages. But that's not always the case.
Everyone will agree that "what's there in the source code that you
don't understand" is an unreasonable response to a question. Or that
pointing to docs to explain heinously obfuscated code is unreasonable.
This is because "obfuscated" is a fluid and subjective category.
Is there really something like "plain code" separate from programmer's
idiom, or a straightforward program as opposed to a trick from the bag?
How good is documentation (and *perlfunc* of all things is regularly
thumped here) for giving someone a feel for why and how, or any kind
of collected wisdom, and *especially* the evolved quirks, or specific
grain of the language, which needs contact with speakers? I am
reminded of a generation of Indians speaking ridiculous Babu English
learned out of formal grammar books... It may be my imagination, but
I also see a smaller bunch of fluent speakers gruffly ordering the
Babus around...
It can go to absurd limits. I once saw someone asking about how to
use some class. "Inherit it" was the curt answer, followed by the
inevitable "which part of the docs don't you understand?". Being
a bit awkward around classes doomed this otherwise completely
reasonable questioner. I am glad it was Ilya Zakharevich answering
MY questions about the subject when I was asking them.
Also, and this may be way too personal a feeling, I do think it is
absurd to cite page numbers of O'Reilly books. I'd prefer absence
of response to advertisements of books. Do I have to pay for perl?
(And if I paid wouldn't I get infinitely politer answers? That's
the paradox with some of the more farcical page-quoting going on.)
I think we should add to the FAQ something to the effect of: If
you want to post a perfectly general RTFM ... STOP! That's been
covered by the FAQ.
------------------------------
Date: Sun, 29 Mar 1998 02:12:05 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Tushar Samant <scribble@pobox.com>
Subject: Re: What does this one liner do?
Message-Id: <Pine.GSO.3.96.980329020554.24340I-100000@user2.teleport.com>
On 28 Mar 1998, Tushar Samant wrote:
> rootbeer@teleport.com writes:
> >On Sat, 28 Mar 1998, Mike wrote:
> >
> >> What does this do? select(undef,undef,undef,0.1);
> >
> >What would you like to know that isn't in the docs?
>
> What the select(2) system call does.
That's in the docs.
> What does it *mean* when you say any of the bitmasks can be undef.
What does it *mean*? Is the statement somehow unclear? "Any of the
bitmasks can be undef" means that the undef value may be used in place of
any of the bitmasks.
> Is sleeping for 0.1 seconds the ONLY effect of the call.
If there are other effects, those should be found in the docs.
> Also, what's come over the group.
That's not in the docs. :-) But the Perl newsgroups are NOT a place to
get answers for questions for which the docs and FAQs are sufficient.
Never have been, never will be.
Of course, if you have suggestions about how the docs can be improved,
(and there's eternally room for improvement) patches are always welcome.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 29 Mar 1998 11:05:22 GMT
From: casteels@uia.ua.ac.be (Paul.Casteels)
Subject: Win32::OLE and Word97
Message-Id: <EqKusy.F7L@uia.ua.ac.be>
I am trying to create a Word document from a Perl script.
This is part of my first attempt:
$Word = Word->new('Word.Application', \&Quit);
$FileN = $Word->Documents->Add($CDTemplate);
$FileN->SaveAs('dada.doc');
The last statement fails with
OLE error 0x80020005: "Type does not match"
in methodcall/getproperty "SaveAs" argument -4677756 at word.pl line 62
What am I doing wrong ?
Paul Casteels casteels@uia.ua.ac.be Tel: +32.3.8202455
Fax: +32.3.8202245
University of Antwerp Dpt.Physics
Universiteitsplein 1
B-2610 Wilrijk
Belgium
------------------------------
Date: Sun, 29 Mar 1998 21:49:07 +1000
From: Andrew Gruskin <agruskin@melbpc.org.au>
Subject: Re: WinAT Scheduling of perl scripts
Message-Id: <351E3533.2722BD45@melbpc.org.au>
John T. Beadles wrote:
> I put the perl call and the script name in a .CMD file, then call the
> .CMD file from the scheduler. Have a substantial amount of experience
> doing this, works fine.
I vote for this method also. I have a number of scripts that have been running for
months with no problems. The .CMD file also makes thing so much tidier. I do
recall having a problem with spaces in my directory names in specifying the path of
the CMD. Of course, this can be easier worked around.
------------------------------
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 2203
**************************************