[28642] in Perl-Users-Digest
Perl-Users Digest, Issue: 10006 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Nov 25 09:05:49 2006
Date: Sat, 25 Nov 2006 06:05:04 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 25 Nov 2006 Volume: 10 Number: 10006
Today's topics:
Re: a short non-working Perl script <john@castleamber.com>
Re: a short non-working Perl script <dr.mtarver@ukonline.co.uk>
Re: ANNOUNCE: CGI::ContactForm 1.40 krakle@visto.com
Re: ANNOUNCE: CGI::ContactForm 1.40 <noreply@gunnar.cc>
Re: ANNOUNCE: CGI::ContactForm 1.40 <noreply@gunnar.cc>
Re: ANNOUNCE: CGI::ContactForm 1.40 (reading news)
Re: ANNOUNCE: CGI::ContactForm 1.40 <noreply@gunnar.cc>
Re: ANNOUNCE: CGI::ContactForm 1.40 <bik.mido@tiscalinet.it>
Re: ANNOUNCE: CGI::ContactForm 1.40 <rvtol+news@isolution.nl>
Re: literal substitution <nobull67@gmail.com>
new CPAN modules on Sat Nov 25 2006 (Randal Schwartz)
Re: seek/tell in presence of multibyte characters <nobull67@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 25 Nov 2006 06:12:28 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: a short non-working Perl script
Message-Id: <Xns988621CAD398castleamber@130.133.1.4>
Tad McClellan <tadmc@augustmail.com> wrote:
> John Bokma <john@castleamber.com> wrote:
>> Pinocchio@visto.com wrote:
>
>>> Nobody who makes a serious Perl script for the web uses CGI.pm to
>>> write HTML.
>
>
>> When is a Perl script serious?
>
>
> Whenever it is not being executed.
Does being stored on CD count? :-)
--
John Experienced Perl programmer: http://castleamber.com/
Perl help, tutorials, and examples: http://johnbokma.com/perl/
------------------------------
Date: 25 Nov 2006 06:04:15 -0800
From: "Mark Tarver" <dr.mtarver@ukonline.co.uk>
Subject: Re: a short non-working Perl script
Message-Id: <1164463455.582753.107230@j72g2000cwa.googlegroups.com>
> PL> Are you *reading* any of these replies? You were given the correct way
> PL> to do this by several different people.
Of course. I now have a working version using cgi.pm.
#!/usr/bin/perl
use strict;
use warnings;
use CGI qw/:standard/;
use CGI::Carp qw/fatalsToBrowser/;
my $name = param('name');
my $email = param('email');
print header();
print start_html('Info');
print h1('Info');
print hr();
print pre("Name: $name<br>\nEmail: $email<br>\n");
print end_html();
_______________________________________________________________
But for my own education I would still like to know the answer to my
question as to how $buffer can read the output of series of forms.
cgi.pm is actually not part of Perl itself, but a package on top of
Perl.
The original program works apart from this one line. Here is an
example where $buffer is set to a string.
_________________________________________________________________
#!/usr/bin/perl
# Reads the input from a forms file and splits it into parts.
$buffer = "name=Mark&email=over the rainbow";
$token = "";
@tokens = ( );
while ($buffer ne "")
{$c = chop($buffer);
if ($c eq "&" || $c eq "=")
{$tokens = push(@tokens, $token); $token = "";}
else
{$token = $c . $token;}
};
push(@tokens, $token);
@tokens = reverse(@tokens);
# Grabs name and email.
shift(@tokens);
$name = shift(@tokens);
shift(@tokens);
$email = shift(@tokens);
#__________________________HTML begins here
print <<END_OF_HTML;
Content-type: text/html
<HTML>
<HEAD>
<TITLE> Info</TITLE>
</HEAD>
<BODY>
<H1> Info</H1>
<HR>
<PRE>
Name: $name <br>
Email: $email <br>
</PRE>
<HR>
</BODY>
</HTML>
END_OF_HTML
print "";
____________________________
produces the correct
<HTML>
<HEAD>
<TITLE> Info</TITLE>
</HEAD>
<BODY>
<H1> Info</H1>
<HR>
<PRE>
Name: Mark <br>
Email: over the rainbow <br>
</PRE>
<HR>
</BODY>
</HTML>
You don't have to answer the question, but the correct answer in Perl
should not be too long.
Mark
------------------------------
Date: 24 Nov 2006 21:45:26 -0800
From: krakle@visto.com
Subject: Re: ANNOUNCE: CGI::ContactForm 1.40
Message-Id: <1164433526.431326.322900@45g2000cws.googlegroups.com>
On Nov 24, 3:31 pm, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
> kra...@visto.com wrote:
> > On Nov 21, 6:04 pm, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
> >>CGI::ContactForm is amodulefor generating web contact forms. It lets
> >>you create an unlimited number of forms with a minimum of effort, and
> >>makes it possible for e.g. web hosting providers to offer their
> >>customers an easy way to set up a contact form.
>
> >>Version 1.40 includes a feature that makes automated submissions by spam
> >>robots more difficult, without the inconvenience of CAPTCHA. Also, since
> >>some people don't like that a copy is sent to the submitted sender
> >>address, an option has been added to not send sender copies.
>
> > Gunnar you of all people should know that comp.lang.perl.misc isn't a
> > place to post announcements for crappy modules that noone will use...So you think it's crappy? Then I look forward to your insightsful code
> criticism.
I find it useless. Because if you write a CGI odds are you DO know
HTML. And if you don't understand HTML and Forms then what the heck are
you doing writing a CGI...
ANYWAY, this is not the place to post announcements. You have been here
long enough to know better. I may of kept my mouth shut if this was a
MAJOR module announcement but this is just merely pointless basic crap
code for newbies. I wonder why you are so proud to display this module
as your flagship... I'd be embarrassed...
------------------------------
Date: Sat, 25 Nov 2006 09:45:54 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: ANNOUNCE: CGI::ContactForm 1.40
Message-Id: <4sqe66F10lmldU1@mid.individual.net>
krakle@visto.com wrote:
> Gunnar Hjalmarsson wrote:
>> krakle@visto.com wrote:
>>> Gunnar you of all people should know that comp.lang.perl.misc isn't a
>>> place to post announcements for crappy modules that noone will use...
>>
>> So you think it's crappy? Then I look forward to your insightsful code
>> criticism.
>
> I find it useless. Because if you write a CGI odds are you DO know
> HTML. And if you don't understand HTML and Forms then what the heck are
> you doing writing a CGI...
Guess I have myself to blame for that, since I asked for your comments...
What would HTML knowledge have to do with inviting the world to send
mail using your own server? With CGI::ContactForm you can do so safely,
with a script as simple as:
#!/usr/bin/perl -T
use CGI::ContactForm;
contactform (
recname => 'John Smith',
recmail => 'john.smith@example.com',
);
__END__
> ANYWAY, this is not the place to post announcements.
That topic is covered in another sub-thread.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Sat, 25 Nov 2006 09:45:57 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: ANNOUNCE: CGI::ContactForm 1.40
Message-Id: <4sqe69F10lmldU2@mid.individual.net>
Randal L. Schwartz wrote:
>
> Gunnar> http://groups.google.com/group/comp.lang.perl.misc/msg/9da3b07a1dd62ee3
>
>>>Whine whine. All I ask is that you use an address for a posting that is a
>>>valid email address that actually reaches a human.
>
> Gunnar> Anybody who reads the (whole) message I linked to can see that that's not true.
>
> What part of it isn't true?
Everything. After some mail exchange, and as stated in the message I
linked to, at 22 February 2005 I let you know that I had created a fresh
email address[1], and posted an announcement from that address. You
didn't even bother to reply.
It appears as if you ask that I expose my _main_ address in the Usenet
archives. If that's the case, your demand is unreasonable.
> Don't lie to the public.
That accusation recoils on yourself.
[1] It's not a working address any longer, so don't try to make a point
by posting to it now, 21 months later...
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Sat, 25 Nov 2006 09:27:58 GMT
From: "Mumia W. (reading news)" <paduille.4060.mumia.w@earthlink.net>
Subject: Re: ANNOUNCE: CGI::ContactForm 1.40
Message-Id: <y0U9h.3673$1s6.1048@newsread2.news.pas.earthlink.net>
On 11/24/2006 11:45 PM, krakle@visto.com wrote:
>
> On Nov 24, 3:31 pm, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
>> kra...@visto.com wrote:
>>> On Nov 21, 6:04 pm, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
>>>> CGI::ContactForm is amodulefor generating web contact forms. It lets
>>>> you create an unlimited number of forms with a minimum of effort, and
>>>> makes it possible for e.g. web hosting providers to offer their
>>>> customers an easy way to set up a contact form.
>>>> Version 1.40 includes a feature that makes automated submissions by spam
>>>> robots more difficult, without the inconvenience of CAPTCHA. Also, since
>>>> some people don't like that a copy is sent to the submitted sender
>>>> address, an option has been added to not send sender copies.
>>> Gunnar you of all people should know that comp.lang.perl.misc isn't a
>>> place to post announcements for crappy modules that noone will use...
[ krakle's crappy quoting fixed ]
>> So you think it's crappy? Then I look forward to your insightsful code
>> criticism.
>
> I find it useless. [...]
So what? The world does not revolve around you.
>
> ANYWAY, this is not the place to post announcements. [...]
I have no problem with people posting announcements in here so long as
the subjects conform to ^ANNOUNCE:
I also have no problem with people creating CPAN modules for newbies.
> I'd be embarrassed...
>
You ought to be. It's back into the twit filter for you krakle.
Gunnar, if you still want to stomach trying to post to a newsgroup
moderated by Randal Schwartz, create a yahoo account, set up appropriate
filters and provide proper instructions to potential respondents, such
as "include the string [CLPA] in the subject line to get a response."
The instructions would go into the announcement and into the module's
README file.
BTW, usenet is a mixture of moderated and unmoderated newsgroups for a
reason[0]. Alt.perl exists for a reason.
--
[0]:
http://groups.google.com/group/comp.lang.perl.misc/msg/9da3b07a1dd62ee3
------------------------------
Date: Sat, 25 Nov 2006 10:52:19 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: ANNOUNCE: CGI::ContactForm 1.40
Message-Id: <4sqi2nF115ol3U1@mid.individual.net>
Mumia W. (reading news) wrote:
> Gunnar, if you still want to stomach trying to post to a newsgroup
> moderated by Randal Schwartz,
I don't. I gave it up 21 months ago. Just wanted to give Michele an
explanation in another sub-thread.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Sat, 25 Nov 2006 11:01:56 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: ANNOUNCE: CGI::ContactForm 1.40
Message-Id: <645gm25qnntl2e0kh01hrmhp2vqo4j35nj@4ax.com>
On Sat, 25 Nov 2006 03:22:32 +0100, Gunnar Hjalmarsson
<noreply@gunnar.cc> wrote:
>I see your point, Michele. There is a group designated for
>announcements, but unfortunately I'm not in a position to use it:
>http://groups.google.com/group/comp.lang.perl.misc/msg/9da3b07a1dd62ee3
And I see your point, in turn.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Sat, 25 Nov 2006 12:17:53 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: ANNOUNCE: CGI::ContactForm 1.40
Message-Id: <ek9cfg.l4.1@news.isolution.nl>
Gunnar Hjalmarsson schreef:
> Randal L. Schwartz:
>> All I ask is that you use an address for a posting
>> that is a valid email address that actually reaches a human.
>
> Anybody who reads the (whole) message I linked to can see that that's
> not true.
What I see is that you didn't understand that you need to use an address
that *permanently* reaches a human. So not just once, for the moderator,
but also for other people, later on.
But later on, with what you called your fifth post, you seem to have
supplied a good address after all, so I don't understand either why that
didn't work out.
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: 25 Nov 2006 04:33:12 -0800
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: literal substitution
Message-Id: <1164457992.451373.236090@l39g2000cwd.googlegroups.com>
Dave Walden wrote:
> J=FCrgen Exner wrote:
> > - use index() to find the location of string $a in $str
> > - use substr() to replace the text
>
> Thanks. That's the memory jog I needed (although not as ideal as
> having an additional qualifier to s/// that turned off regex control
> character interpretation).
Did you miss kens' reply?
s/\Q$a/$b/;
------------------------------
Date: Sat, 25 Nov 2006 05:42:15 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sat Nov 25 2006
Message-Id: <J99uIF.MD7@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
AI-PSO-0.86
http://search.cpan.org/~kylesch/AI-PSO-0.86/
Module for running the Particle Swarm Optimization algorithm
----
AnyEvent-2.1
http://search.cpan.org/~mlehmann/AnyEvent-2.1/
provide framework for multiple event loops
----
App-CLI-0.07
http://search.cpan.org/~clkao/App-CLI-0.07/
Dispatcher module for command line interface programs
----
Archive-Extract-0.15_01
http://search.cpan.org/~kane/Archive-Extract-0.15_01/
A generic archive extracting mechanism
----
B-Keywords-1.05
http://search.cpan.org/~jjore/B-Keywords-1.05/
Lists of reserved barewords and symbol names
----
CGI-ContactForm-1.41
http://search.cpan.org/~gunnar/CGI-ContactForm-1.41/
Generate a web contact form
----
CGI-Session-4.20_1
http://search.cpan.org/~markstos/CGI-Session-4.20_1/
persistent session data in CGI applications
----
CGI-Session-Driver-memcached_mysql-0.01
http://search.cpan.org/~oinume/CGI-Session-Driver-memcached_mysql-0.01/
CGI::Session driver for memcached and mysql
----
Catalyst-Plugin-Email-Japanese-0.05
http://search.cpan.org/~typester/Catalyst-Plugin-Email-Japanese-0.05/
Send Japanese emails with Catalyst
----
Catalyst-Plugin-Email-Japanese-0.06
http://search.cpan.org/~typester/Catalyst-Plugin-Email-Japanese-0.06/
Send Japanese emails with Catalyst
----
Data-Dump-1.07
http://search.cpan.org/~gaas/Data-Dump-1.07/
Pretty printing of data structures
----
DateTime-Format-Natural-0.13
http://search.cpan.org/~schubiger/DateTime-Format-Natural-0.13/
----
DateTime-Format-Natural-EN-0.12
http://search.cpan.org/~schubiger/DateTime-Format-Natural-EN-0.12/
Create machine readable date/time with natural parsing logic
----
IPC-Cmd-0.36
http://search.cpan.org/~kane/IPC-Cmd-0.36/
finding and running system commands made easy
----
Language-Prolog-Sugar-0.06
http://search.cpan.org/~salva/Language-Prolog-Sugar-0.06/
Syntactic sugar for Prolog term constructors
----
Language-Prolog-Yaswi-0.13
http://search.cpan.org/~salva/Language-Prolog-Yaswi-0.13/
Yet another interface to SWI-Prolog
----
Language-Prolog-Yaswi-0.14
http://search.cpan.org/~salva/Language-Prolog-Yaswi-0.14/
Yet another interface to SWI-Prolog
----
Math-Intersection-StraightLine-0.03
http://search.cpan.org/~reneeb/Math-Intersection-StraightLine-0.03/
Calculate intersection point for two lines
----
Module-Depends-Tree-1.00
http://search.cpan.org/~petdance/Module-Depends-Tree-1.00/
A container for functions for the deptree program
----
Module-Pluggable-3.3
http://search.cpan.org/~simonw/Module-Pluggable-3.3/
automatically give your module the ability to have plugins
----
Mozilla-Mechanize-GUITester-0.06
http://search.cpan.org/~bosu/Mozilla-Mechanize-GUITester-0.06/
enhances Mozilla::Mechanize with GUI testing.
----
Perl-Critic-More-0.12
http://search.cpan.org/~cdolan/Perl-Critic-More-0.12/
Supplemental policies for Perl::Critic
----
SVK-1.99_04
http://search.cpan.org/~clkao/SVK-1.99_04/
A Distributed Version Control System
----
Scalar-Quote-0.26
http://search.cpan.org/~salva/Scalar-Quote-0.26/
Utility functions to quote Perl strings
----
Sort-Key-1.27
http://search.cpan.org/~salva/Sort-Key-1.27/
the fastest way to sort anything in Perl
----
Test-CheckManifest-0.8
http://search.cpan.org/~reneeb/Test-CheckManifest-0.8/
Check if your Manifest matches your distro
----
Test-File-1.17
http://search.cpan.org/~bdfoy/Test-File-1.17/
test file attributes
----
Text-CSV-DetectSeparator-0.02
http://search.cpan.org/~reneeb/Text-CSV-DetectSeparator-0.02/
Helps to find the fieldseparator in a csv-file
----
WWW-Patent-Page-0.09
http://search.cpan.org/~anonwb/WWW-Patent-Page-0.09/
get a patent page or document (e.g. htm, pdf, tif) from selected source (e.g. from United States Patent and Trademark Office (USPTO) website or the European Patent Office (ESPACE_EP). and place into a
----
WebService-BBC-MusicCharts-0.01
http://search.cpan.org/~dwilson/WebService-BBC-MusicCharts-0.01/
Retrieve and return UK music chart listings
----
WebService-SongLyrics-0.01
http://search.cpan.org/~dwilson/WebService-SongLyrics-0.01/
Retrieve song lyrics from www.songlyrics.com
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: 25 Nov 2006 04:27:02 -0800
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: seek/tell in presence of multibyte characters
Message-Id: <1164457622.521422.87140@m7g2000cwm.googlegroups.com>
Robert Dodier wrote:
> I would like to call seek and tell on files which contain multibyte
> characters (utf8).
> perldoc -f seek says that seek only considers byte offsets, not
> character offsets.
> How can I implement a seek-like function which takes a character
> offset?
Why? No, seriously, why?
What meaning does a character offset have?
If you just want to get back to a position you've visited before then
byte offsets (or even opaque constructs) are prefectly adequate.
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 V10 Issue 10006
****************************************