[29161] in Perl-Users-Digest
Perl-Users Digest, Issue: 405 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 4 14:09:48 2007
Date: Fri, 4 May 2007 11:09:06 -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 Fri, 4 May 2007 Volume: 11 Number: 405
Today's topics:
Re: 2 array problem <abigail@abigail.be>
Re: 2 array problem <bik.mido@tiscalinet.it>
Re: 2 array problem <uri@stemsystems.com>
Re: Double backslash behavior not as expected <damercer@comcast.net>
Re: Lisp for the C21 <http://phr.cx@NOSPAM.invalid>
Perl code explaination help needed! keepyourstupidspam@yahoo.co.uk
Re: Perl code explaination help needed! <news@lawshouse.org>
Re: Perl code explaination help needed! <bik.mido@tiscalinet.it>
Re: Perl code explaination help needed! <bik.mido@tiscalinet.it>
Re: Perl code explaination help needed! <bik.mido@tiscalinet.it>
Re: Perl code explaination help needed! <nobull67@gmail.com>
Re: perl out of memory xlue897@rogers.com
Populating an array from a mysql select <nikos1337@gmail.com>
Populating an array from a mysql select <nikos1337@gmail.com>
Re: Populating an array from a mysql select <news@lawshouse.org>
Re: Populating an array from a mysql select <paduille.4061.mumia.w+nospam@earthlink.net>
Re: Populating an array from a mysql select (Gary E. Ansok)
Question about Perl <rafael.avaria@gmail.com>
Re: Web Forms / Perl / SPAM detection <uctraing@ultranet.com>
Re: Web Forms / Perl / SPAM detection <uctraing@ultranet.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 04 May 2007 15:07:18 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: 2 array problem
Message-Id: <slrnf3mj0d.hl5.abigail@alexandra.abigail.be>
anno4000@radom.zrz.tu-berlin.de (anno4000@radom.zrz.tu-berlin.de) wrote
on MMMMCMXCIV September MCMXCIII in <URL:news:5a0mi2F2mebjmU1@mid.dfncis.de>:
:: Abigail <abigail@abigail.be> wrote in comp.lang.perl.misc:
:: > anno4000@radom.zrz.tu-berlin.de (anno4000@radom.zrz.tu-berlin.de) wrote
:: > on MMMMCMXCIV September MCMXCIII in <URL:news:5a0et1F2mflpoU1@mid.dfncis.de>:
:: > @@ katera <katera@tovle.ct> wrote in comp.lang.perl.misc:
:: > @@ > Help
:: > @@ >
:: > @@ > I have 2 array @a @b
:: > @@
:: > @@ You should avoid the variable names "a" and "b" in Perl, they have
:: > @@ special significance and don't behave like other variables in
:: > @@ all respects.
:: >
:: > Well, that's only $a and $b.
::
:: Yes, but they're package variables, so @a and $a aren't completely
:: independent.
::
:: use strict; use warnings;
:: my ( @l);
::
:: # a legit use of $a and $b
:: @l = sort { $a <=> $b } 1, 2, 3;
::
:: # ... makes @a behave differently
:: @l = @main::a; # no warning "once" here
::
:: # ... from @x
:: @l = @main::x; # this warns
::
:: Here the "...used only once" warning is not issued for @a. If the
:: "sort" line is commented out, the warning appears for both @a and @x.
What makes you think @a is special?
#!/usr/bin/perl
use strict;
use warnings;
no warnings 'syntax';
my @l;
use vars qw '$c $d';
@l = sort {$c <=> $d} 1, 2, 3;
@l = @main::c; # no warning "once" here
@l = @main::x; # this warns
__END__
That '@a' doesn't warn in your example has little to do with @a being
special. It just has to do with the fact that *a exists. Which exists
because you used $a.
If you use $c, then you won't get the warning on the package
variable @c either.
Not that you should use package variables if not necessary.
Abigail
--
# Count the number of lines; code doesn't match \w. Linux specific.
()=<>;$!=$=;($:,$,,$;,$")=$!=~/.(.)..(.)(.)..(.)/;
$;++;$*++;$;++;$*++;$;++;`$:$,$;$" $. >&$*`;
------------------------------
Date: Fri, 04 May 2007 18:27:19 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: 2 array problem
Message-Id: <5mnm33h3207b0e0eptvsrtlemj326alaf3@4ax.com>
On 04 May 2007 15:07:18 GMT, Abigail <abigail@abigail.be> wrote:
>That '@a' doesn't warn in your example has little to do with @a being
>special. It just has to do with the fact that *a exists. Which exists
That's surely what Anno meant. As you surely know full well.
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: Fri, 04 May 2007 13:32:16 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: 2 array problem
Message-Id: <x73b2cebq7.fsf@mail.sysarch.com>
>>>>> "p" == phus <phus@live.com> writes:
p> my @a= ("123;first", "124;second", "013;bla3", "011;bla4",
p> "050;bla5");
p> my @b= ('123','011','000','050'); # not 123 but '123', etc
p> my @c = grep {!exists(${{map {$_=>1} @b}}{(m/^(\d+)/)[0]})} @a;
yow!! do you realize that you are building the anon exists hash for EACH
iteration of the grep? that hash should be built before the grep line
and used inside to replace the map.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Fri, 4 May 2007 08:19:42 -0500
From: "Dan Mercer" <damercer@comcast.net>
Subject: Re: Double backslash behavior not as expected
Message-Id: <bIydnQjwypBsr6bbnZ2dnUVZ_oKnnZ2d@comcast.com>
"John W. Krahn" <someone@example.com> wrote in message news:Q5x_h.1690$Vi6.1400@edtnps82...
: alt.testing@{g}mail.com wrote:
: > Hi all,
: > the simple concept of escaping a "backslash", thus translating to a
: > literal backslash; does not provide the implied result, under the
: > following example.
: >
: > $mount_result = qx#strace /bin/mount -t smbfs \\\\$machine\\documents
Use:
$mount_result = qx#strace /bin/mount -t smbfs '\\\\$machine\\documents'
which the shell will see as '\\an2\documents'
Dan Mercer
: > /mnt/workstation_shares/$mount/documents/ -o ro -o username=$user -o
: > password=$pass#;
: >
: > The top part of the "strace" output gives this:
: >
: > execve("/bin/mount", ["/bin/mount", "-t", "smbfs", "\\an2documents",
: > "/mnt/workstation_shares/xxxx/doc"..., "-o", "ro", "-o",
: > "username=xxxx", "-o", "password=xxxxxxxxxx"], [/* 22 vars */]) = 0
: >
: > "\\an2documents"
: >
: > Note; that there is no "\" in between the machine name, and the share.
: > It should be "\\an2\documents".
: >
: > [root@mercedes sbin]# perl -e 'print "\\\\an2\\documents\n"'
: > \\an2\documents
: >
: >
: > I'm sure it's a simple thing, but can someone enlighten me on this
: > parlay?
:
: Your string is interpolated twice, once by perl and then by the shell.
:
: $ perl -le'
: $machine = "an2";
: $mount = "xxxx";
: print qx#echo /bin/mount -t smbfs
: \\\\$machine\\documents/mnt/workstation_shares/$mount/documents/#;
: '
: /bin/mount -t smbfs \an2documents/mnt/workstation_shares/xxxx/documents/
:
:
: You need to double up on the back-slashes.
:
: $ perl -le'
: $machine = "an2";
: $mount = "xxxx";
: print qx#echo /bin/mount -t smbfs
: \\\\\\\\$machine\\\\documents/mnt/workstation_shares/$mount/documents/#;
: '
: /bin/mount -t smbfs \\an2\documents/mnt/workstation_shares/xxxx/documents/
:
:
:
:
:
: John
: --
: Perl isn't a toolbox, but a small machine shop where you can special-order
: certain sorts of tools at low cost and in short order. -- Larry Wall
------------------------------
Date: 04 May 2007 08:32:14 -0700
From: Paul Rubin <http://phr.cx@NOSPAM.invalid>
Subject: Re: Lisp for the C21
Message-Id: <7x1whwwqo1.fsf@ruckus.brouhaha.com>
Mark Tarver <dr.mtarver@ukonline.co.uk> writes:
> See my remarks on the Lisp for the Twenty First Century
> http://www.lambdassociates.org/lC21.htm
Anyone who didn't love lisp in the 20th century has no heart.
Anyone who still loves it in the 21st, has no head.
------------------------------
Date: 4 May 2007 08:11:31 -0700
From: keepyourstupidspam@yahoo.co.uk
Subject: Perl code explaination help needed!
Message-Id: <1178291491.672813.200460@n76g2000hsh.googlegroups.com>
Hi,
Can someone explain to me what this line of perl is doing.
/(\S*)\.C$/;
it is used in this function
@list = `ls *.C`;
foreach (@list) {
chop;
/(\S*)\.C$/;
rename("$1.C", "$1.cc") || die "Can't rename $1 !\n";
Thank you.
EM
------------------------------
Date: Fri, 04 May 2007 16:30:21 +0100
From: Henry Law <news@lawshouse.org>
Subject: Re: Perl code explaination help needed!
Message-Id: <1178292604.26637.0@proxy00.news.clara.net>
keepyourstupidspam@yahoo.co.uk wrote:
> Can someone explain to me what this line of perl is doing.
>
> /(\S*)\.C$/;
> @list = `ls *.C`;
>
> foreach (@list) {
> chop;
> /(\S*)\.C$/;
> rename("$1.C", "$1.cc") || die "Can't rename $1 !\n";
This is the kind of Perl code that exploits the defaults; it can be
confusing to read, because it doesn't look like "sentences" where you
can see what was operated on by what and where the result went. The
line you're querying is a match, operating on the default variable $_
(which is set to each element of @list as, once again, the default in
"foreach"). So it's the same as
$_ =~ m/(\S*)\.C$/;
... in other words it extracts a non-whitespace string from the front of
a filename like "foo.C" and sets $1 to whatever that string was - "foo"
in this case.
--
Henry Law Manchester, England
------------------------------
Date: Fri, 04 May 2007 18:37:18 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Perl code explaination help needed!
Message-Id: <hpnm33puov94p187vdv057lgvfq73vobk8@4ax.com>
On 4 May 2007 08:11:31 -0700, keepyourstupidspam@yahoo.co.uk wrote:
>Can someone explain to me what this line of perl is doing.
>
>/(\S*)\.C$/;
Match a sequence of zero or more non-space charachters followed by a
literal dot followed by a C at the end of the string or just before a
newline at the end of the string.
>it is used in this function
>
>
>@list = `ls *.C`;
Get the output of the ls shell command. Probably just a clumsy and non
portable way to do
my @list = glob '*.C';
or roll your own readdir(), etc.
>foreach (@list) {
> chop;
Old way to do chomp(); anyway, intended to remove a newline at the end
of a string.
> /(\S*)\.C$/;
Ditto as above.
> rename("$1.C", "$1.cc") || die "Can't rename $1 !\n";
Change the extension of the file from .C to .cc, and -globally- a
horrible and error-prone way to do so.
Personally, I would do
for (glob '*.C') {
my ($new=$_) =~ s/C$/cc/;
rename $_ => $new or
die "Can't rename `$_' to `$new': $!\n";
}
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: Fri, 04 May 2007 18:44:54 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Perl code explaination help needed!
Message-Id: <ocom33l3rci2qdks9c576fnplrplncb4rh@4ax.com>
On Fri, 04 May 2007 16:30:21 +0100, Henry Law <news@lawshouse.org>
wrote:
>> @list = `ls *.C`;
>>
>> foreach (@list) {
>> chop;
>> /(\S*)\.C$/;
>> rename("$1.C", "$1.cc") || die "Can't rename $1 !\n";
>
>This is the kind of Perl code that exploits the defaults; it can be
>confusing to read, because it doesn't look like "sentences" where you
>can see what was operated on by what and where the result went. The
This is the kind of Perl code that makes me want to puke, since it's
clearly aimed at changing the extension of *.C filenames to .cc, but
does so in an error prone way: what if some filename contains any
space? (Ok, unlikely!) Not to mention the other quirks. All this has
*nothing* to do with exploiting the defaults.
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: Fri, 04 May 2007 18:52:25 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Perl code explaination help needed!
Message-Id: <r4pm331dreecls5eg72jg9h52rg6tgoilo@4ax.com>
On Fri, 04 May 2007 18:37:18 +0200, Michele Dondi
<bik.mido@tiscalinet.it> wrote:
>Personally, I would do
>
> for (glob '*.C') {
> my ($new=$_) =~ s/C$/cc/;
> rename $_ => $new or
> die "Can't rename `$_' to `$new': $!\n";
> }
Or, with a single statement, (which doesn't seem too much of a
stretch, here)
rename $_ => do { local $_=$_; s/C$/cc/; $_ }
or die "Can't rename `$_': $!\n"
for glob '*.C';
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: 4 May 2007 10:53:09 -0700
From: Brian McCauley <nobull67@gmail.com>
Subject: Re: Perl code explaination help needed!
Message-Id: <1178301189.327784.281360@n76g2000hsh.googlegroups.com>
On May 4, 5:37 pm, Michele Dondi <bik.m...@tiscalinet.it> wrote:
> my ($new=$_) =~ s/C$/cc/;
You mean
(my $new=$_) =~ s/C$/cc/;
------------------------------
Date: 4 May 2007 10:33:26 -0700
From: xlue897@rogers.com
Subject: Re: perl out of memory
Message-Id: <1178300006.641403.233160@n76g2000hsh.googlegroups.com>
On May 2, 1:21 pm, Michele Dondi <bik.m...@tiscalinet.it> wrote:
> On Wed, 02 May 2007 15:31:13 GMT, "J=FCrgen Exner"
>
> <jurge...@hotmail.com> wrote:
> >The magic of reading a line at a time works for 'while(<>)' only.
>
> ATM! :-)
>
> Michele
> --
> {$_=3Dpack'B8'x25,unpack'A8'x32,$a^=3Dsub{pop^pop}->(map substr
> (($a||=3Djoin'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB=3D'
> .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=3D~/./g)x2,$_,
> 256),7,249);s/[^\w,]/ /g;$ \=3D/^J/?$/:"\r";print,redo}#JAPH,
Thanks everyone for your help. The while loop works. However, the
perl code seems much slower than awk code. For the same file size
around 5M records, the awk takes only 1 min to loop to find the max
value, the perl takes around 20 mins. Does perl slower than awk?
Thanks.
Steven
------------------------------
Date: 4 May 2007 08:22:43 -0700
From: Nikos <nikos1337@gmail.com>
Subject: Populating an array from a mysql select
Message-Id: <1178292163.761801.231030@l77g2000hsb.googlegroups.com>
$select =3D $db->prepare( "SELECT username FROM users" );
$select->execute;
my @userlist =3D $select->fetchrow_array;
print start_form( action=3D>'/cgi-bin/index.pl' );
print h1( {class=3D>'lime'}, "=C5=F0=DD=EB=E5=EE=E5 =F4=EF =EA=E5=DF=
=EC=E5=ED=EF =F0=EF=F5 =F3=E5 =E5=ED=E4=E9=E1=F6=DD=F1=E5=E9
=3D> ",
popup_menu( -name=3D>'select', -values=3D>
\@userlist ),
submit('=C5=EC=F6=DC=ED=E9=F3=E7'));
print end_form;
In the above code insteaf od the array filling by all usernmes
selected from the dataabse it only populates the 1st one.
I want all users to be listed on the pop up menu.
------------------------------
Date: 4 May 2007 08:24:00 -0700
From: Nikos <nikos1337@gmail.com>
Subject: Populating an array from a mysql select
Message-Id: <1178292240.281478.314940@c35g2000hsg.googlegroups.com>
$select =3D $db->prepare( "SELECT username FROM users" );
$select->execute;
my @userlist =3D $select->fetchrow_array;
print start_form( action=3D>'/cgi-bin/index.pl' );
print h1( {class=3D>'lime'}, "=C5=F0=DD=EB=E5=EE=E5 =F4=EF =EA=E5=DF=
=EC=E5=ED=EF =F0=EF=F5 =F3=E5 =E5=ED=E4=E9=E1=F6=DD=F1=E5=E9
=3D> ",
popup_menu( -name=3D>'select', -values=3D>
\@userlist ),
submit('=C5=EC=F6=DC=ED=E9=F3=E7'));
print end_form;
In the above code insteaf od the array filling by all usernmes
selected from the dataabse it only populates the 1st one.
I want all users to be listed on the pop up menu.
------------------------------
Date: Fri, 04 May 2007 16:37:24 +0100
From: Henry Law <news@lawshouse.org>
Subject: Re: Populating an array from a mysql select
Message-Id: <1178293028.52899.0@demeter.uk.clara.net>
Nikos wrote:
> $select = $db->prepare( "SELECT username FROM users" );
> $select->execute;
> my @userlist = $select->fetchrow_array;
> In the above code insteaf od the array filling by all usernmes
> selected from the dataabse it only populates the 1st one.
fetchrow_array fetches the _fields_ from one row of your result set as a
list; in this case it's a one-element list containing the username. You
need to code a loop, getting each row of the result set in turn and
handling it.
Like this (untested and almost certainly broken)
while (my @userlist = $select->fetchrow_array ) {
popup_menu( -name=>'select', -values=> $userlist[0] );
}
--
Henry Law Manchester, England
------------------------------
Date: Fri, 04 May 2007 15:58:20 GMT
From: "Mumia W." <paduille.4061.mumia.w+nospam@earthlink.net>
Subject: Re: Populating an array from a mysql select
Message-Id: <wKI_h.3585$296.1819@newsread4.news.pas.earthlink.net>
On 05/04/2007 10:24 AM, Nikos wrote:
> $select = $db->prepare( "SELECT username FROM users" );
> $select->execute;
> my @userlist = $select->fetchrow_array;
^^^^^^^^^^^^^^
>
> print start_form( action=>'/cgi-bin/index.pl' );
> print h1( {class=>'lime'}, "Επέλεξε το κείμενο που σε ενδιαφέρει
> => ",
> popup_menu( -name=>'select', -values=>
> \@userlist ),
> submit('Εμφάνιση'));
> print end_form;
>
>
> In the above code insteaf od the array filling by all usernmes
> selected from the dataabse it only populates the 1st one.
>
> I want all users to be listed on the pop up menu.
>
Fetchrow_array only gets a single row at a time. Perhaps you want
something like this (untested):
my @userlist = map $_->[0], @{$select->fetchall_arrayref};
------------------------------
Date: Fri, 4 May 2007 16:36:25 +0000 (UTC)
From: ansok@alumni.caltech.edu (Gary E. Ansok)
Subject: Re: Populating an array from a mysql select
Message-Id: <f1fne9$4qp$1@naig.caltech.edu>
In article <1178292163.761801.231030@l77g2000hsb.googlegroups.com>,
Nikos <nikos1337@gmail.com> wrote:
>$select = $db->prepare( "SELECT username FROM users" );
>$select->execute;
>my @userlist = $select->fetchrow_array;
>
>In the above code insteaf od the array filling by all usernmes
>selected from the dataabse it only populates the 1st one.
You might want to look at the function selectcol_arrayref()
rather than doing the prepare, execute, and fetch separately.
my $userlist = $db->selectcol_arrayref("SELECT username FROM users");
# now @$userlist should be an array containing the user names
On a more general note, my usual way of doing database queries
(assuming the expected number of rows is not too large, so that
holding all the data in memory is not a problem) has become
my $aref = $db->selectall_arrayref($sql, { Slice => {} }, @values);
foreach my $row (@$aref) {
# do something with $row->{col1_name}, $row->{col2_name}, etc.
}
Gary Ansok
--
Any attempt to brew coffee with a teapot should result in the error code
"418 I'm a teapot". The resulting entity body MAY be short and stout.
- RFC 2324, Hyper Text Coffee Pot Control Protocol (HTCPCP)/1.0
------------------------------
Date: 4 May 2007 09:11:06 -0700
From: lala4life <rafael.avaria@gmail.com>
Subject: Question about Perl
Message-Id: <1178295066.667092.318140@p77g2000hsh.googlegroups.com>
Hi gurus
Exists something similar to WCF (windows communication foundation)
by Perl side (or any GNU project)?
The WCF is an abstraction of a communication layer, where is no
problem of the programmer open socket, control them, communicate with
another host that have MQ, Java etc.
A WCF Service have a collections of endpoint (Listener) that have a
contract (a contract is an assembly (Class) that describe the type of
message, the kind of data to be transmited it allow complex types or
structured by serialization, the type of serialization, the scope of
the operation, behavior of the message if requiere security SSL WS ,
allows transaction, etc) and receipt messages from a client, here both
side can act as client or server.
All this is done by configuration, is necessary something of code in
the contract.
------------------------------
Date: Fri, 04 May 2007 13:59:52 GMT
From: - Bob - <uctraing@ultranet.com>
Subject: Re: Web Forms / Perl / SPAM detection
Message-Id: <gtem33du3nlefivbftj60inr2eteqggceu@4ax.com>
On Fri, 04 May 2007 03:02:10 +0200, Gunnar Hjalmarsson
<noreply@gunnar.cc> wrote:
>Michael Vilain wrote:
>> I renamed all the fields to generic names (e.g. FIELD1, FIELD2, etc.)
>> and added a HIDDEN field which I gave a default value of "" in the form.
>> In the form processing script (this was PHP, but it will work in PERL
>> also), if the hidden field has a non-blank value, I know a BOT has
>> filled out the form and I don't process it further. Only a human
>> filling out the form and pressing SUBMIT will process it.
>>
>> Simple and it seems to work. No BOTs have sent me email for a while now.
>
>Interesting. Do you know if it's the generic names or the hidden fields
>that is the key of success? Or is it the combination?
Interesting solution. I am thinking that the hidden field is the only
one that really counts. Some bots might go away if they don't see any
fields like "name", "address", "comment", etc, but if you have a
hidden field named "comment", any that stick around will likely fill
it in and reveal their bot-ness.
------------------------------
Date: Fri, 04 May 2007 14:02:10 GMT
From: - Bob - <uctraing@ultranet.com>
Subject: Re: Web Forms / Perl / SPAM detection
Message-Id: <nnem33tbqqstrbpamduauehpovkhikngbl@4ax.com>
On Fri, 04 May 2007 00:31:28 +0200, Gunnar Hjalmarsson
<noreply@gunnar.cc> wrote:
<>
>The CPAN module CGI::ContactForm includes a cookie based spam prevention
>feature. It's not waterproof, but it does stop some of the bots.
>> When a load of link spamming bots were hitting our contact forms I found
>> that ignoring any message with '</a>' or '[/url]' in got rid of 99% of the
>> crap.
>
>I suppose that would stop the rest of the bots for me too.
Good point... every bot that has hit me has pasted HTML in... That's
probably a good detector.
------------------------------
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 V11 Issue 405
**************************************