[13263] in Perl-Users-Digest
Perl-Users Digest, Issue: 673 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Aug 29 12:19:11 1999
Date: Sun, 29 Aug 1999 09:05:09 -0700 (PDT)
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 Aug 1999 Volume: 9 Number: 673
Today's topics:
Re: *HTTP_REFERER IN STUPID NETSCAPE!!??!?!?!?!? <gellyfish@gellyfish.com>
Re: Books , Reccomend? (Dave Cross)
CGI in PERL <bsdtruck@email.msn.com>
Re: close'ing STDIN <gellyfish@gellyfish.com>
Re: Encryption <gellyfish@gellyfish.com>
Re: FormMail problem recognizing <form name> attribute <gellyfish@gellyfish.com>
Re: FormMail problem recognizing <form name> attribute <flavell@mail.cern.ch>
GD.pm sine2117@my-deja.com
Re: GD.pm <gellyfish@gellyfish.com>
Re: How do I ... ? <gellyfish@gellyfish.com>
Re: Images <gellyfish@gellyfish.com>
Re: mail client having problems with script generated m <gellyfish@gellyfish.com>
Re: mail client having problems with script generated m sandals@my-deja.com
Re: Matching E-mail (Anno Siegel)
Re: Matching E-mail (Bill Moseley)
newbie question: collecting multiple selections with sc <maureen@islandwebdesign.com>
Re: newbie question: collecting multiple selections wit <maureen@islandwebdesign.com>
Re: Perl Y2K Bugs on the Internet <gellyfish@gellyfish.com>
Re: Perl Y2K Bugs on the Internet (Benjamin Franz)
Re: Read File And Read WEB html? <gellyfish@gellyfish.com>
Re: regex bug: (?:\d{3})+ loses count (Anno Siegel)
Re: regex bug: (?:\d{3})+ loses count <rick.delaney@home.com>
Re: run perl by browser sine2117@my-deja.com
Re: run perl by browser <samay1NOmaSPAM@hotmail.com>
Searching an array (Bill Moseley)
Re: The extent of double-quotish interpolation (Mark W. Schumann)
using ftplib.pl <ragopal@bol.net.in>
Re: Will you help me solve this (Larry Rosler)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 29 Aug 1999 12:47:20 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: *HTTP_REFERER IN STUPID NETSCAPE!!??!?!?!?!?
Message-Id: <7qba4o$2mq$1@gellyfish.btinternet.com>
On Sun, 29 Aug 1999 17:17:21 +1000 *briguy* wrote:
>
> helllllpppppp.
>
> when i load a .pl file from a html file on the server with netscape, the
> http_referer environment variable is always returned as empty, however
> when i load the perl script again from the html file using explorer the
> HTTP_REFERER evnvoronment variable is always eturned with a value...
>
WHAT ARE YOU ON ABOUT ?
This has nothing to do with Perl - I think that you might have better
luck if you ask in a group such as comp.infosystems.www.browsers or
comp.infosystems.www.authoring.cgi : in the latter case I think that
you might be advised to read the CGI faq first which can be found at:
<http://www.webthing.com/tutorials/cgifaq.html>
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 29 Aug 1999 14:56:19 GMT
From: dave@dave.org.uk (Dave Cross)
Subject: Re: Books , Reccomend?
Message-Id: <37ca49f5.8347082@news.demon.co.uk>
On Tue, 24 Aug 1999 11:22:26 -0700, Makarand Kulkarni
<makkulka@cisco.com> wrote:
>[ Tim wrote:
>
>> Can someone recommend a book tha twould be a good step up?
>
>Get hold of the books (1) and (2)
>
>1. CGI Programming with Perl, Second Edition
>By Gundavaram, Shishir
>Make sure you get the latest edition published 09/1999
According to O'Reilly
<http://www.oreilly.com/catalog/cgi2/noframes.html>, this has been put
back to June 2000.
Dave...
--
Dave Cross <dave@dave.org.uk>
<http://www.dave.org.uk>
------------------------------
Date: Sun, 29 Aug 1999 10:43:28 -0400
From: "Nate" <bsdtruck@email.msn.com>
Subject: CGI in PERL
Message-Id: <#5Ph4xi8#GA.273@cpmsnbbsa03>
Do I need to learn/know any other language prior to PERL if I want to learn
CGI in PERL?
Thanks.
Nate
------------------------------
Date: 29 Aug 1999 16:12:05 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: close'ing STDIN
Message-Id: <7qbm4l$34v$1@gellyfish.btinternet.com>
On Thu, 26 Aug 1999 09:50:21 -0400 Julio Kuplinsky wrote:
> Consider this code fragment
>
> @files = <STDIN>;
> .......
> chomp ($ans = <STDIN>);
>
> If I invoke this as
>
> grep -l foo * | <myprogram>
>
> then @files does get the filenames, but execution does *not* stop to
> read the user response into $ans. No, saying
>
> close STDIN;
>
> doesn't help.
>
Thats right. You will need to open an alternative filehandle to
accept input from the user - this will depend on what OS you are using
on unix it might be '/dev/tty' for instance.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 29 Aug 1999 13:09:29 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Encryption
Message-Id: <7qbbe9$2n6$1@gellyfish.btinternet.com>
On Sun, 29 Aug 1999 00:55:12 -0500 J. A. Myers wrote:
> You will find the answer to most module questions at www.cpan.org .
> You will find a PGP module there.
Although I'm not entirely sure whether this is a 'pure perl' module as
specified by the original poster - although the rest of your answer is
absolutely true.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 29 Aug 1999 12:42:35 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: FormMail problem recognizing <form name> attribute
Message-Id: <7qb9rr$2mn$1@gellyfish.btinternet.com>
On Fri, 27 Aug 1999 19:28:52 GMT Shawn Powell wrote:
> David Cassell wrote:
>
>> One more bit of advice: if that's Matt Wright's FormMail
>> script, get a better formmail program ASAP.
>
> What is wrong with it, and what would you recommend instead?
Actually as far as the majority of Matt Wright's productions go it is
not too bad - it even gets its date handling right. However there are
still a number of things wrong with it:
sub check_email {
# Initialize local email variable with input to subroutine. #
$email = $_[0];
# If the e-mail address contains: #
if ($email =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/ ||
# the e-mail address contains an invalid syntax. Or, if the #
# syntax does not match the following regular expression pattern #
# it fails basic syntax verification. #
$email !~ /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$
/) {
This will reject a vast array of perfectly legal and valid addresses -
for instance ..@gellyfish.com : it is making a false assumption about
what is valid in the host-specific part of the address which it shouldnt.
# Open The Mail Program
open(MAIL,"|$mailprog -t");
The success of this should have been checked - if the fork fails then all
that follows is pointless.
close (MAIL);
The return of this should be checked - as it will indicate a problem with
sendmail.
I wont go into the nasty handrolled form parsing code and the fact that
the script could be used by the unscrupulous to send anonymous spam or
that it is basically of Perl 4 vintage using 'local' where it should be
using 'my' and so on and so forth ...
As for a recommendation well I couldnt really as I have never had the
need for such a thing.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 29 Aug 1999 15:56:19 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: FormMail problem recognizing <form name> attribute
Message-Id: <Pine.HPP.3.95a.990829154954.8289E-100000@hpplus03.cern.ch>
On 29 Aug 1999, Jonathan Stowe wrote:
> As for a recommendation well I couldnt really as I have never had the
> need for such a thing.
CGIemail seems to have a good reputation. But it isn't in Perl, and
it's explicitly targetted at unix-based servers.
http://web.mit.edu/wwwdev/cgiemail/webmaster.html
[f'ups set out of clpm]
------------------------------
Date: Sun, 29 Aug 1999 12:40:55 GMT
From: sine2117@my-deja.com
Subject: GD.pm
Message-Id: <7qb9om$s3o$1@nnrp1.deja.com>
Hello, i'm trying to install GD.pm on my server, but i can't get it
working.. i download the package, untar it, compile it as the
instructions tells me.. but when i try to use it in my perl program
whith the line 'use GD;' it tells me that GD.pm could not be found..
and thats true, i don't have any file named GD.pm.. i thought it was
that file i was downloading in the package..
Where is that darn file ?? help me!
Best regards Sine.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 29 Aug 1999 15:43:53 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: GD.pm
Message-Id: <7qbkfp$32u$1@gellyfish.btinternet.com>
On Sun, 29 Aug 1999 12:40:55 GMT sine2117@my-deja.com wrote:
> Hello, i'm trying to install GD.pm on my server, but i can't get it
> working.. i download the package, untar it, compile it as the
> instructions tells me.. but when i try to use it in my perl program
> whith the line 'use GD;' it tells me that GD.pm could not be found..
> and thats true, i don't have any file named GD.pm.. i thought it was
> that file i was downloading in the package..
> Where is that darn file ?? help me!
>
You did do 'make install' didnt you ?
From your headers it appears that you are posting from a Win98 machine -
if you are trying to install GD on this platform and you are using the
Activestate distribution then perhaps you should be using PPM (Perl package
manager) to install the module:
C:\> ppm install GD
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 29 Aug 1999 13:16:03 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How do I ... ?
Message-Id: <7qbbqj$2ne$1@gellyfish.btinternet.com>
On 28 Aug 1999 16:38:00 GMT Pete Holsberg wrote:
> Pete Holsberg (pjh@mccc.edu) wrote:
> :
> : I'm reading fixed length values into a set of variable
> : (data file is a screen dump) and the values are of course
> : padded with trailing blanks. (I'm trying to convert each
> : screen's values into a line of delimited field values.)
> :
> : Is there a simply way to eliminate those blanks?
>
> Never mind. $var =~ s/ +$//; did it.
>
Of course if you had looked in the FAQ (specifically perlfaq4) you
would have found the section entitled:
=head2 How do I strip blank space from the beginning/end of a string?
Which would have given the answer.
In general if you have a question such as this it is best to look in the
FAQ before posting as the majority of times the answer will be found there.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 29 Aug 1999 16:01:52 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Images
Message-Id: <7qblhg$33k$1@gellyfish.btinternet.com>
On Fri, 27 Aug 1999 17:56:15 GMT Jimmy Humphrey wrote:
> Martien Verbruggen wrote:
>
>> In article <37C55DE0.842A763B@blackhole-designs.com>,
>> Jimmy Humphrey <jimmy@blackhole-designs.com> writes:
>> > Content-Type: text/plain; charset=us-ascii
>>
>> Please don't do that. Usenet is a plain text medium. Not a MIME
>> circus. And not a web application crappy thingy that deals with HTML.
>> And don't put your message before what you quote, and don't quote your
>> own message. It's not Jeopardy here.
>>
>> IOW: before posting again, please fix your usenet posting style.
>>
> Hey, I just hit the reply button on Netscape 4.6 and hit send.
>
On your keyboard between the main section and the numeric keypad there will
be found two sets of keys : the bottom set are marked with arrows pointing
in four directions one of which happens to point down - you can use this
key to move the point at which new text will be inserted to be at the
bottom of that which you are replying. In the upper block of keys there
is a key marked 'delete' that can be used to delete any unwanted text
from the quoted material - this should include the signature of the
person you are replying to.
Hope That Helps.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 29 Aug 1999 12:53:10 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: mail client having problems with script generated mail
Message-Id: <7qbafm$2mt$1@gellyfish.btinternet.com>
On Sun, 29 Aug 1999 07:14:21 GMT sandals@my-deja.com wrote:
> I have a CGI script that sends mail. HOwever when I try to get the mail
> it sents for some reason outlook express can't download the mail. I get
> a message indicating that my POP3 server is not responding. However if
> if go to my Windows NT based mail server, and manually delete the one
> email, outlook express is then able to download the rest of my mail.
> Another stange thing is that if I send the mail to a Unix hosted mail
> server, I can download the mail. All ideas are welcomed.
>
<snip code implementing SMTP>
I would recommend using the module Net::SMTP in order that you can rule out
it is your usage of SMTP at fault.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 29 Aug 1999 14:17:52 GMT
From: sandals@my-deja.com
Subject: Re: mail client having problems with script generated mail
Message-Id: <7qbfeb$vl8$1@nnrp1.deja.com>
Solved the problem by changing
print MAIL "\n.\n";
to:
print MAIL "\r\n.\r\n";
In article <7qamk9$g8a$1@nnrp1.deja.com>,
sandals@my-deja.com wrote:
> I have a CGI script that sends mail. HOwever when I try to get the
mail
> it sents for some reason outlook express can't download the mail. I
get
> a message indicating that my POP3 server is not responding. However if
> if go to my Windows NT based mail server, and manually delete the one
> email, outlook express is then able to download the rest of my mail.
> Another stange thing is that if I send the mail to a Unix hosted mail
> server, I can download the mail. All ideas are welcomed.
>
> The code that seems to be casing the problem is:
>
> sub sendmail {
>
> # error codes below for those who bother to check result codes <gr>
>
> # 1 success
> # -1 $smtphost unknown
> # -2 socket() failed
> # -3 connect() failed
> # -4 service not available
> # -5 unspecified communication error
> # -6 local user $to unknown on host $smtp
> # -7 transmission of message failed
> # -8 argument $to empty
> #
> # Sample call:
> #
> # &sendmail($from, $reply, $to, $smtp, $subject, $message );
> #
> # Note that there are several commands for cleaning up possible bad
> inputs - if you
> # are hard coding things from a library file, so of those are
> unnecesssary
> #
>
> my ($fromaddr, $replyaddr, $to, $smtp, $subject, $message) = @_;
>
> $to =~ s/[ \t]+/, /g; # pack spaces and add comma
> $fromaddr =~ s/.*<([^\s]*?)>/$1/; # get from email address
> $replyaddr =~ s/.*<([^\s]*?)>/$1/; # get reply email address
> $replyaddr =~ s/^([^\s]+).*/$1/; # use first address
> $message =~ s/^\./\.\./gm; # handle . as first character
> $message =~ s/\r\n/\n/g; # handle line ending
> $message =~ s/\n/\r\n/g;
> $smtp =~ s/^\s+//g; # remove spaces around $smtp
> $smtp =~ s/\s+$//g;
>
> if (!$to)
> {
> return(-8);
> }
>
> if ($SMTP_SERVER ne "")
> {
> my($proto) = (getprotobyname('tcp'))[2];
> my($port) = (getservbyname('smtp', 'tcp'))[2];
>
> my($smtpaddr) = ($smtp =~
> /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/)
> ? pack('C4',$1,$2,$3,$4)
> : (gethostbyname($smtp))[4];
>
> if (!defined($smtpaddr))
> {
> return(-1);
> }
>
> if (!socket(MAIL, AF_INET, SOCK_STREAM, $proto))
> {
> return(-2);
> }
>
> if (!connect(MAIL, pack('Sna4x8', AF_INET, $port, $smtpaddr)))
> {
> return(-3);
> }
>
> my($oldfh) = select(MAIL);
> $| = 1;
> select($oldfh);
>
> $_ = <MAIL>;
> if (/^[45]/)
> {
> close(MAIL);
> return(-4);
> }
>
> print MAIL "helo $SMTP_SERVER\r\n";
> $_ = <MAIL>;
> if (/^[45]/)
> {
> close(MAIL);
> return(-5);
> }
>
> print MAIL "mail from: <$fromaddr>\r\n";
> $_ = <MAIL>;
> if (/^[45]/)
> {
> close(MAIL);
> return(-5);
> }
>
> foreach (split(/, /, $to))
> {
> print MAIL "rcpt to: <$_>\r\n";
> $_ = <MAIL>;
> if (/^[45]/)
> {
> close(MAIL);
> return(-6);
> }
> }
>
> print MAIL "data\r\n";
> $_ = <MAIL>;
> if (/^[45]/)
> {
> close MAIL;
> return(-5);
> }
>
> }
>
> if ($SEND_MAIL ne "")
> {
> open (MAIL,"| $SEND_MAIL");
> }
>
> print MAIL "To: $to\n";
> print MAIL "From: $fromaddr\n";
> print MAIL "Reply-to: $replyaddr\n" if $replyaddr;
> print MAIL "X-Mailer: Perl Powered Socket Mailer\n";
> print MAIL "Subject: $subject\n\n";
> print MAIL "$message";
> print MAIL "\n.\n";
>
> if ($SMTP_SERVER ne "")
> {
> $_ = <MAIL>;
> if (/^[45]/)
> {
> close(MAIL);
> return(-7);
> }
>
> print MAIL "quit\r\n";
> $_ = <MAIL>;
> }
>
> close(MAIL);
> return(1);
> }
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 29 Aug 1999 12:36:12 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Matching E-mail
Message-Id: <7qb9fs$n4c$1@lublin.zrz.tu-berlin.de>
Alan J. Flavell <flavell@mail.cern.ch> wrote in comp.lang.perl.misc:
>Comments? :-}
>
How is Bun Mui?
Anno
--
$,=$"; $\=$/;
print map { m/"(\w*)"/g } map { eval; $@ } 'another->Just', 'Hacker->Perl';
------------------------------
Date: Sun, 29 Aug 1999 07:13:53 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: Matching E-mail
Message-Id: <MPG.1232dffa748d70819896dc@nntp1.ba.best.com>
David Cassell (cassell@mail.cor.epa.gov) seems to say...
> Webmaster wrote:
> >
> > if ($form{'email'} =~ /.+\@.+/)
> Excuse me, but that may be the *worst* e-mail address detector
> ever to appear in this newsgroup.
Here's one I came across while updating someone's script. It detects a
URL:
if (/[0-9a-zA-Z]*\.[0-9a-zA-Z]*/) {
Good thing the character classes are there!
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: Sun, 29 Aug 1999 08:51:17 -0400
From: Maureen Dunlap <maureen@islandwebdesign.com>
Subject: newbie question: collecting multiple selections with script
Message-Id: <37C92CC5.DB54C5EA@islandwebdesign.com>
This is a multi-part message in MIME format.
--------------9696E483FFD1C2891857FC9D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi,
Please forgive this newbie request for advice... I have a program with a
wizard that created a script for me to collect form data submitted on
the web and populate my Access database. (I don't know if this script
is written in perl or C or what ) Anyway, it works fine except that my
form contains many checkboxes for the user to make choices and submit
those as well. If the person selects multiple choices the script
returns an error - if it's only one there is no problem.
How can I add a statement in this script that says "create a new record
for each selection made"?
I appreciate any advice - If you don't mind I'm sending the script, it's
not very long.
Thanks much,
Maureen - here's the script:
########################################
&datasource("DSN=Catalog")
&defvar(?numpairs?,?paircount?,?nv?,?field?,?value?,?tablename?)
&assign(?tablename?,"Customers")
&print("Collecting e-mail data...")
&getmails("mydomain.com","user","pass")
{
&print("getting mail ?mailnumber?")
# reset field and value strings
&assign(?field?,"",?value?,"")
# split e-mail text into array of name/value pairs
&split(?pairs?,"?mailbody?","&")
&arraysize(?numpairs?,?pairs?)
# process each name-value pair
&repeat(?paircount?,?numpairs?)
{
# split name/value pairs
&split(?namevalue?,"?pairs[?paircount?]?","=")
# unpack the data, and translate any single ' chars into double ' '
chars
# (required to prevent errors in SQL INSERT statement)
&repeat(?nv?,2)
{
&replace(?namevalue[?nv?]?,"?namevalue[?nv?]?","+"," ")
&unpack(?namevalue[?nv?]?,"?namevalue[?nv?]?")
&replace(?namevalue[?nv?]?,"?namevalue[?nv?]?","'","''")
}
# add field & values to strings
# only add field name/values if value actually contains something
&if("?namevalue[2]?",ne,"")
{
&assign(?field?,"?field?[?namevalue[1]?]")
&assign(?value?,"?value?'?namevalue[2]?'")
# separate field names & values with comma unless last ones
&if(?paircount?!=?numpairs?)
{
&assign(?field?,"?field?, ")
&assign(?value?,"?value?, ")
}
}
&arraydelete(?namevalue?)
}
&html("error.txt",formatnone)
{
"INSERT INTO ?tablename? (?field?) VALUES (?value?)"
}
&sqlnr("INSERT INTO ?tablename? (?field?) VALUES(?value?)")
&arraydelete(?pairs?)
}
--------------9696E483FFD1C2891857FC9D
Content-Type: text/x-vcard; charset=us-ascii;
name="maureen.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Maureen Dunlap
Content-Disposition: attachment;
filename="maureen.vcf"
begin:vcard
n:Dunlap;Maureen
x-mozilla-html:FALSE
adr:;;;;;;
version:2.1
email;internet:maureen@islandwebdesign
note:Novell Certified Internet Professional
x-mozilla-cpt:;-1
fn:Maureen Dunlap
end:vcard
--------------9696E483FFD1C2891857FC9D--
------------------------------
Date: Sun, 29 Aug 1999 11:37:29 -0400
From: Maureen Dunlap <maureen@islandwebdesign.com>
Subject: Re: newbie question: collecting multiple selections with script
Message-Id: <37C953B9.169DE65A@islandwebdesign.com>
This is a multi-part message in MIME format.
--------------545C48AE5E3A8C42650EFCBB
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
My apologies! It seems this program is not written in perl or C. I will
look elsewhere for a solution.
Maureen Dunlap
--------------545C48AE5E3A8C42650EFCBB
Content-Type: text/x-vcard; charset=us-ascii;
name="maureen.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Maureen Dunlap
Content-Disposition: attachment;
filename="maureen.vcf"
begin:vcard
n:Dunlap;Maureen
x-mozilla-html:FALSE
adr:;;;;;;
version:2.1
email;internet:maureen@islandwebdesign
note:Novell Certified Internet Professional
x-mozilla-cpt:;-1
fn:Maureen Dunlap
end:vcard
--------------545C48AE5E3A8C42650EFCBB--
------------------------------
Date: 29 Aug 1999 13:40:36 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl Y2K Bugs on the Internet
Message-Id: <7qbd8k$2o4$1@gellyfish.btinternet.com>
In comp.lang.perl.misc Lee Fesperman <firstsql@ix.netcom.com> wrote:
> Joe Wright wrote:
>>
>> Why do you suppose tm_year is deficient? It is an int. It won't roll
>> over from 99 to 00.
>
> tm_year is a poor design. It produces date displays like,
>
> Jan 1, 100 and Jan 1, 19100
>
> It is conducive to errors. *All* programmers make errors.
>
Fine but the point is that it is documented correctly as to its behaviour:
tm_year
The number of years since 1900.
(from ctime(3)).
This is the same as the case with localtime()[5] in Perl - it is only
conducive to errors where the programmer hasnt read or has failed to
understand the documentation.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 29 Aug 1999 14:14:21 GMT
From: snowhare@long-lake.nihongo.org (Benjamin Franz)
Subject: Re: Perl Y2K Bugs on the Internet
Message-Id: <1fby3.609$CY6.92041@typhoon01.swbell.net>
In article <7qbd8k$2o4$1@gellyfish.btinternet.com>,
Jonathan Stowe <gellyfish@gellyfish.com> wrote:
>In comp.lang.perl.misc Lee Fesperman <firstsql@ix.netcom.com> wrote:
>>
>> It is conducive to errors. *All* programmers make errors.
>>
>
>Fine but the point is that it is documented correctly as to its behaviour:
>
> tm_year
> The number of years since 1900.
>
>(from ctime(3)).
And the non-Unix C people were suppposed to know that how?
Before the Blue Camel came out in late 1996, the behaviour was
essentially undocumented (a bad thing for just over 1100 days
from Jan 1, 2000). The Pink Camel said "don't worry about it."
Worse - it didn't mention 'ctime' in relation to tm structs
and on page 321 it actually *used* "19$year"!
My 19th printing of 1st edition K&R C doesn't mention ctime
or tm structs at all (yes - I've since bought both second
editions, the pre-ANSI and the post-ANSI one).
People like me who were -aware- of the issue but didn't actually
know what it did in Perl since it was undocumented (and hence
couldn't trust it to work the same between different
machines) wrote things like this:
if ($year < 70) {
$year += 2000;
}
if ($year < 1900) {
$year += 1900;
}
Then all three likely cases worked:
98,99,00,01 -> 1998,1999,2000,2001 (classic Y2K)
98,99,100,101 -> 1998,1999,2000,2001 (C, Perl)
98,99,2000,2001 -> 1998,1999,2000,2001 (JavaScript)
--
Benjamin Franz
------------------------------
Date: 29 Aug 1999 12:56:58 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Read File And Read WEB html?
Message-Id: <7qbamq$2n0$1@gellyfish.btinternet.com>
On Sun, 29 Aug 1999 06:19:04 +0800 Liao Yen Feng wrote:
> i have a perl script in A server ( 10.0.0.1,
> path=\home\perltest\cgi-bin\abc.pl)
> and i want to read a webhtml...on http://10.0.0.2/data.html
> how to do this?...
>
You will need to use one of the LWP modules that are part of the
libwww-perl suite available from CPAN <http://www.perl.com/CPAN>
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 29 Aug 1999 13:27:59 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: regex bug: (?:\d{3})+ loses count
Message-Id: <7qbcgv$n77$1@lublin.zrz.tu-berlin.de>
Bart Lateur <bart.lateur@skynet.be> wrote in comp.lang.perl.misc:
>Can somebody confirm or deny this is indeed a bug, or that it has been
>fixed already. I've tried this on the latest (?) ports of Activestate
>(MSWin32) and DJGPP (dos) (both 5.005). It looks like the {n} modifier
>looses count if it's inside a (?:...) construct, followed by a '*', '+'
>or '?' modifier.
>
>I stumbled across it when I tried to roll my own "commify" code. (This
>version only "works" for integers.)
>
> #! perl -w
> $_ = '1234567890';
> ($good = $_) =~ s/(\d)(?=(?:\d\d\d)+(?!\d))/$1,/g;
> print "Good: $good\n";
> ($bad = $_) =~ s/(\d)(?=(?:\d{3})+(?!\d))/$1,/g;
> print "Bad: $bad\n";
> ($ugly = $_) =~ s/(\d)(?=(?:\d{3})(?:\d{3})*(?!\d))/$1,/g;
> print "Ugly: $ugly\n";
>-->
> Good: 1,234,567,890
> Bad: 1,2,3,4,5,6,7,8,9,0
> Ugly: 1,2,3,4,5,6,7,890
>
>IMO, it should give the same result for all three.
It does here:
Good: 1,234,567,890
Bad: 1,234,567,890
Ugly: 1,234,567,890
This is perl, version 5.005_03 built for i586-linux
Anno
--
$,=$"; $\=$/;
print map { m/"(\w*)"/g } map { eval; $@ } 'another->Just', 'Hacker->Perl';
------------------------------
Date: Sun, 29 Aug 1999 13:39:11 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: regex bug: (?:\d{3})+ loses count
Message-Id: <37C937E9.D8BDFC8D@home.com>
[posted & mailed]
Bart Lateur wrote:
>
> Can somebody confirm or deny this is indeed a bug, or that it has been
> fixed already. I've tried this on the latest (?) ports of Activestate
> (MSWin32) and DJGPP (dos) (both 5.005). It looks like the {n} modifier
> looses count if it's inside a (?:...) construct, followed by a '*', '+'
> or '?' modifier.
[snip code]
I ran your code and got 1,234,567,890 for all 3 tests with the following
perls:
Summary of my perl5 (5.0 patchlevel 5 subversion 03) configuration:
Platform:
osname=MSWin32, osvers=4.0, archname=MSWin32-x86-object
yada, yada, yada...
Locally applied patches:
ActivePerl Build 516
Built under MSWin32
Summary of my perl5 (5.0 patchlevel 4 subversion 02) configuration:
Platform:
osname=MSWin32, osvers=4.0, archname=MSWin32
Summary of my perl5 (5.0 patchlevel 4 subversion 4) configuration:
Platform:
osname=linux, osvers=2.0.33, archname=i586-linux
Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
Platform:
osname=linux, osvers=2.0.34, archname=i586-linux
> p.s. I can't use perlbug, because I can't mail from within perl. The
> script simply dies. Bloody scripts... ;-)
Can't you just save the report to a file and then mail it yourself? Or
don't use perlbug and compose it yourself. But if you compose it
yourself you'll still probably want to use `perlbug -vd` to get your
config data.
perldoc perlbug
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Sun, 29 Aug 1999 12:56:20 GMT
From: sine2117@my-deja.com
Subject: Re: run perl by browser
Message-Id: <7qbali$soh$1@nnrp1.deja.com>
In article <37C8D942.8BFCB5DC@singnet.com.sg>,
andriani@singnet.com.sg wrote:
> hi guys, sorry to disturb you.
> i can run my program with command line but when i tried to invoke my
> program using html( post method) to submit the form data, it doesn't
> work. and the browser ask me whether i want to download file. i run my
> program in PC using windows 98.
> i have tried to find the answer in FAQ but i couldn't solve my
problem
> thank you in advance
> bye
>
> andriani
>
>Ok, if i got you right you are using perl for dos, and your program is
running perfect on the command line. But when you use your browser to
browse to the file ex'c:\perl\prog.pl' the browser asks you to download
the file.. If you want to run you perl program from a browser you need
to have a web-server that compiles the program and gives the result to
the browser. I use linux for this, i know that there is a webserver for
windows callded 'personal web server' or something, but i don't use it..
Another basic thing when calling a perl-script from a browser, is to
write out the document-header, like this: 'print "content-Type:
text/html\n\n";' so the browser knows that the following text is text
or html code.
Good luck!
Best Regards Sine
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Sun, 29 Aug 1999 07:49:46 -0700
From: Samay <samay1NOmaSPAM@hotmail.com>
Subject: Re: run perl by browser
Message-Id: <01906254.75f30251@usw-ex0107-049.remarq.com>
If you want to run browser by perl, that's easy and
possible..
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: Sun, 29 Aug 1999 08:04:51 -0700
From: moseley@best.com (Bill Moseley)
Subject: Searching an array
Message-Id: <MPG.1232ebebbea341d9896dd@nntp1.ba.best.com>
I've got an array of hashes, sorted by one of the fields in the hash,
say 'name'. The array is between 5000 and 8000 elements long.
What I'd like to do is pass to a sub an array letters and return back
the first position the letter in located in the array.
@starting_points( \@sorted_array, qw/a k s x/ );
I know, I should benchmark, but I haven't started writing yet. So I'm
wondering if anyone already does this, and if so, what's a good fast
approach for an array of this size.
The FAQ suggests just run down the length of the array. But I'm
wondering at what point (array size) it would make sense to be a little
smarter in the searches, perhaps by doing the recursive divide in half
approach.
I love to end up with a nice Abigail-ish one-liner.
Thanks for the pointers,
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: 29 Aug 1999 10:29:12 -0400
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: The extent of double-quotish interpolation
Message-Id: <7qbg3o$be1@junior.apk.net>
In article <m1pv071yoy.fsf@halfdome.holdit.com>,
Randal L. Schwartz <merlyn@stonehenge.com> wrote:
>>>>>> "Mark" == Mark W Schumann <catfood@apk.net> writes:
>
>>> Perl doesn't interpolate expressions, just variables.
>
>Mark> Gracious. I think I just understood that, and it perfectly explains my
>Mark> recent disagreements with perl on this topic.
>
>As long as you remember that this is one of those rules where "20%
>covers 80%, and it would take another 80% to explain the other 20%".
I'll take it though. A "good enough" answer is better than total
confusion.
------------------------------
Date: Sun, 29 Aug 1999 21:32:17 +0530
From: Raj Gopal <ragopal@bol.net.in>
Subject: using ftplib.pl
Message-Id: <37C95989.576353AE@bol.net.in>
Hi,
I have written a simple script to automatically fetch a file from a
remote server using ftp.
I am using ftplib.pl
The problem is that when i "get" a binary file the filesize larger than
the orginal filesize( I am setting the tranfer mode to "binary".
this is the code
#!c:\perl\bin\perl.exe
require "ftplib.pl";
$testConnect=&ftp'open ("80.0.0.2","raj","123");
&ftp'type("i");
&ftp'get("philips.txt");
&ftp'close;
The ftp server shows that the tranfer mode has been set to binary..
TIA,
Raj
------------------------------
Date: Sun, 29 Aug 1999 08:26:30 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Will you help me solve this
Message-Id: <MPG.1232f102b2a90954989ecc@nntp.hpl.hp.com>
In article <37c8d7e0$0$17161@nntp1.ba.best.com> on 29 Aug 1999 06:49:04
GMT, John Callender <jbc@shell2.la.best.com> says...
...
> This has been one of the harder things for me to pick up as I work
> through my own Perl newbie-hood. Historically these functions weren't
> documented very well in the Perl docs (at least for someone not
> familiar with the C functions of the same name, from which they take
> their syntax); now there's a fairly complete explanation in the
> perlfunc manpage under sprintf, but it's still pretty rough going for
> someone completely unfamiliar with it, and could benefit from a few
> examples, maybe, at least for dweebs like me.
These presumptions about familiarity with the C library (printf,
localtime as being discussed yet again in another thread, etc.) and with
Unix system calls were defects in the documentation based on mistaken
assumptions about the users of Perl. They are gradually being fixed.
Perl started out as a 'better' Unix shell, after all.
...
> $item = 'bread';
> $cost = 1.59235;
> printf "The cost of $item is \$%1.2f", $cost;
> # prints 'The cost of bread is $1.59'
An undocumented Gotcha: What would be printed if 'item' contained a '%'
-- 'bread at 20% off'?
As a general rule, interpolating arbitrary strings into the format is
risky, because they will then be subject to interpretation as a format.
Code like that is far better written this way:
printf "The cost of %s is \$%1.2f", $item, $cost;
Interpolating formats is of course OK, because you presumably know what
you're doing.
-------
It was good to meet you in Monterey. What a blast, eh?
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 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.
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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu.
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 673
*************************************