[13799] in Perl-Users-Digest
Perl-Users Digest, Issue: 1209 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 28 06:05:31 1999
Date: Thu, 28 Oct 1999 03:05:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <941105112-v9-i1209@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 28 Oct 1999 Volume: 9 Number: 1209
Today's topics:
Can find (a,b) differentiate btn a and b directories ? <achin@inprise.com>
Re: Circular buffering (Abigail)
Re: efficient diff algorithm (Greg McCarroll)
Re: Email::Valid module and rfc compliant addresses (Abigail)
Re: EXECUTE <procname> with Oraperl <gellyfish@gellyfish.com>
Re: file sorting,, repeated <gellyfish@gellyfish.com>
Re: Frames with perl (Abigail)
Re: HELP --> Save output in a variable (Abigail)
How to avoid FILEHANDLE reusage.. <f00baz@my-deja.com>
How to divide output records per page ? <hmaster@factory.co.kr>
Re: How to get the system time?? (Abigail)
Re: HTML::Parser <xeon@g-em.com>
Re: HTML::Parser <gellyfish@gellyfish.com>
Re: Ignore the idiots (Abigail)
Re: Is Perl a good language for making text-based games (Greg McCarroll)
Re: Is Perl a good language for making text-based games (Abigail)
Re: Is Perl a good language for making text-based games (Abigail)
is there a Perl module for checksum (or CRS)? <Anttoni@iname.com>
Re: linking to perl script to html page. (Abigail)
Re: mod perl anomalies (I.J. Garlick)
MySQL RPM requires /usr/bin/perl5 <cklumb@bayou.\"ReMovE\"uh.edu>
Re: Newbie: graphic counter:shes-a no work! <gellyfish@gellyfish.com>
Re: OT: Newsreader? a.k.a Re: Ignore the idiots (Abigail)
Re: POST data to a perl program, from a perl program (Abigail)
Re: Scripts that invoke one another via Location: and/o (Ben Blish)
Re: Scripts that invoke one another via Location: and/o (Ben Blish)
Re: Scripts that invoke one another via Location: and/o (Abigail)
Re: Scripts that invoke one another via Location: and/o <gellyfish@gellyfish.com>
Re: What makes the web go? (Abigail)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 28 Oct 1999 17:03:34 +0800
From: Adrian Chin <achin@inprise.com>
Subject: Can find (a,b) differentiate btn a and b directories ?
Message-Id: <7v9396$jcd2@nntp.interbase.com>
Hi
I wanted to know if any way that I can differentiate btn a and b
directories and the files within a and b as well ?
I want to write a script that do a compare btn each files within a and b
directories.
Thanks
------------------------------
Date: 28 Oct 1999 02:49:50 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Circular buffering
Message-Id: <slrn81fvvo.66b.abigail@alexandra.delanet.com>
Neil Cherry (njc@dmc.uucp) wrote on MMCCXLIX September MCMXCIII in
<URL:news:slrn81f9n2.b7n.njc@dmc.uucp>:
$$
$$ What I meant by circular buffers is a fixed size array were a pointer
$$ points to the current position in the array to put new characters and
$$ a pointer that points to the last read character. I come from an
$$ assembly/C background and these are common in interrupt routines. I
$$ have to read characters from the serial port and need to send a bunch
$$ first then react to the characters then send a response based on the
$$ the characters just read.
push/shift or pop/unshift need to move the entire array eventually.
Here's an implementation that doesn't.
package Circular::Modulo;
sub TIESCALAR {bless [$_ [2] || 0, $_ [1]] => $_ [0]}
sub FETCH {${$_ [0]} [0]}
sub STORE {${$_ [0]} [0] = $_ [1] % ${$_ [0]} [1]}
package Circular;
use strict;
use Exporter;
use vars qw /@ISA @EXPORT @EXPORT_OK/;
@ISA = qw /Exporter/;
@EXPORT = qw /cb_create cb_query cb_insert/;
@EXPORT_OK = qw //;
# $$buf [0] points to the next available position.
# $$buf [1] points to the last read position.
# $$buf [2] is the buffer.
# The buffer contains on extra position to make it easier to
# distinguish between a full and an empty buffer.
# Full: $$buf [0] == $$buf [1].
# Empty: $$buf [0] == $$buf [1] + 1.
# $$buf [0] and $$buf [1] are tied, so it's easier to do modulo arithmetic.
sub cb_create {
my $size = shift or die "Failed to create new buffer\n";
my $buf = [0, $size => [(undef) x ($size + 1)]];
tie $$buf [0] => 'Circular::Modulo', $size + 1, 0;
tie $$buf [1] => 'Circular::Modulo', $size + 1, $size;
$buf;
}
# In scalar context, return one element; die if buffer empty.
# In list context, return all elements. (Clears buffer).
sub cb_query {
my $buf = shift or die "Failed to get buffer\n";
if (wantarray) {
my @result = $$buf [1] < $$buf [0] ?
@{$$buf [2]} [$$buf [1] + 1 .. $$buf [0] - 1] :
@{$$buf [2]} [$$buf [1] + 1 .. $#{$$buf [2]},
0 .. $$buf [0] - 1];
$$buf [1] = $$buf [0] - 1;
return @result;
}
elsif (defined wantarray) {
die "Buffer empty\n" if $$buf [0] == ($$buf [1] + 1) % @{$$buf [2]};
$$buf [1] ++;
${$$buf [2]} [$$buf [1]];
}
else {
$$buf [1] = $$buf [0] - 1;
}
}
# Die if buffer is full.
sub cb_insert {
my $buf = shift or die "Failed to get buffer\n";
die "Buffer full\n" if $$buf [1] == $$buf [0];
${$$buf [2]} [$$buf [0]] = shift;
$$buf [0] ++;
return;
}
__END__
Abigail
--
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Thu, 28 Oct 1999 08:20:39 GMT
From: greg@mccarroll.demon.co.uk (Greg McCarroll)
Subject: Re: efficient diff algorithm
Message-Id: <38180317.6935460@newspull.london1.eu.level3.net>
On Wed, 27 Oct 1999 20:04:28 GMT, Mark Lofdahl <mel@disc.com> wrote:
>I'm looking for an implementation of diff in perl. I've looked at the
>Algorithm::Diff module on CPAN, but I don't think that will work for
>me. Part of the way it works (as far as I could tell) is to create a 2-
>dimensional array that is <number of lines of file1> x <number of lines
>of file2>. If I'm diffing 1000 x 1000 lines, that's a 1,000,000 element
>array. My machine runs out of memory way before that.
>
>Is there another diff algorithm out there? Maybe one that is implemented
>more like the unix diff program?
>
if you read the documentation of Algorithm::Diff it explains why it is
so complicated, it depends on your exact application if there is a
simpler one. If you want to describe exactly what you want I might be
able to provide another option,
Greg
------------------------------
Date: 28 Oct 1999 03:21:54 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Email::Valid module and rfc compliant addresses
Message-Id: <slrn81g1s4.66b.abigail@alexandra.delanet.com>
Craig Berry (cberry@cinenet.net) wrote on MMCCXLIX September MCMXCIII in
<URL:news:s1fl08l3r0891@corp.supernews.com>:
::
:: Just out of curiosity, why that naming scheme for RFC module groups? Why
:: not RFC::822::Address?
That's explained in the manual of RFC::RFC822::Address....
\begin{quote}
This module should have been named C<RFC::822::Address>. However, perl
5.004 doesn't like the C<822> part, and at the time of this writing
MacPerl is still at 5.004.
\end{quote}
Abigail
--
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
"\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
"\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 28 Oct 1999 10:19:06 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: EXECUTE <procname> with Oraperl
Message-Id: <3818150a_1@newsread3.dircon.co.uk>
In comp.lang.perl.misc NetComrade <netcomradeNOSPAM@earthlink.net> wrote:
> DOes anybody know how to EXECUTE procedures from ORAPERL?
> A piece of code would be nice....
> We had been experience a problem where the scripts simply exits
I think you will find the answer if you search Deja News for "Stored Procedure".
Such as :
http://www.deja.com/qs.xp?ST=PS&svcclass=dnyr&QRY=&defaultOp=AND&DBS=1&OP=dnquery.xp&LNG=ALL&subjects=Oracle+Stored+Procedure&groups=comp.lang.perl.misc
For instance
/J\
--
"William Hague, the world's favourite hairline" - Rory Bremner
------------------------------
Date: 28 Oct 1999 10:07:54 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: file sorting,, repeated
Message-Id: <3818126a_1@newsread3.dircon.co.uk>
V.B. <spyder@pikesville.net> wrote:
> HI!
> im back with my sorting questions. what am i doing wrong?
>
Not posting as a followup to the original thread springs to mind ...
>
> this is my code:
>
> open (FILE,"<./stats.log")
This wont even compile without the semicolon - you also want to check
the success of the open.
open (FILE,"./stats.log") || die "Can't open stats.log - $!\n";
> @rate = (map substr($_, 1 + rindex $_,"\0") =>
> reverse sort
> map +(split /;/)[6]."\0$_" =>
> <FILE>);
> close (FILE);
> open (FILE,">./rate.log")
This also needs the semicolon and the check of success ...
> print FILE @rate;
>
>
> this is the info i want sorted:
You are sorting on the wrong field then if you want the 6th one - also
you will want to use a numeric sort by supplying a sort sub that uses
the '<=>' operator ( the other benefit is that you can swap the $a & $b):
@rate = map { substr($_, 1 + rindex $_,"\0" ) }
sort { $b <=> $a }
map { (split /;/)[5] . "\0" }
<FILE>;
(Sorry Larry but I just had to lose those '=>' )
/J\
--
"You don't watch the Eurovision Song Contest to hear good music" -
Katrina Leskanich, Katrina and the Waves
------------------------------
Date: 28 Oct 1999 02:57:57 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Frames with perl
Message-Id: <slrn81g0f7.66b.abigail@alexandra.delanet.com>
Jacques Bulchand Gidumal (jacques@istac.rcanaria.es) wrote on MMCCXLVIII
September MCMXCIII in <URL:news:3816F827.D84112CF@istac.rcanaria.es>:
`` I have a HTML page with two frames. In the first, I have a FORM that
`` calls a perl script. I would like the perl script to write on the second
`` frame, so the form on the first frame will stay there. How can I do
`` this?
The same way as you would do this if your form processing program was
written in Cobol, APL or PostScript.
The browser really doesn't care.
Abigail
--
perl -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
print chr 0x$& and q
qq}*excess********}'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 28 Oct 1999 03:03:17 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: HELP --> Save output in a variable
Message-Id: <slrn81g0p8.66b.abigail@alexandra.delanet.com>
BARBET Alain (abarb@nmg.fr) wrote on MMCCXXXIV September MCMXCIII in
<URL:news:380485E0.FFEA9442@nmg.fr>:
!! Marco Cerqui a écrit :
!!
!! > Hi
!! > In a script I want to save the output of a command -->system(ypwhich)<--
!! > into a variable. Can someone help me please ?
!!
!! You can redirect output in a file and then read it ... and you can have the
!! return code of your call with $retourcode=system("ypwhich>>/tmp/toto");
You shouldn't ask questions if you haven't read the documentation,
but you certainly should not *answer* them either.
Abigail
--
$_ = "\x3C\x3C\x45\x4F\x54" and s/<<EOT/<<EOT/e and print;
Just another Perl Hacker
EOT
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Thu, 28 Oct 1999 07:41:37 GMT
From: F00 Baz <f00baz@my-deja.com>
Subject: How to avoid FILEHANDLE reusage..
Message-Id: <7v8unh$cfh$1@nnrp1.deja.com>
Hello people, here I was writing some kind of code, which is supposed to
sniff throught directory three using recursion, and create files there.
However, I got stuck with the problem, that FILEHANDLEs are getting reused,
so I just get complete junk with it. Roughly code looks something like this:
&sniff("./"); exit(1); sub sniff { my $dir=shift; chdir $dir; opendir(...);
open(INDEXFL,"index"); my @duh=readdir(..); for (@duh) { &sniff($_) if ( -d
$_); } print INDEXFL "$_\n"; } closedir(..); clise(INDEXFL); chdir(..); } And
the problem here is that INDEXFL, is being used over and over again (without
re-allocating new memory in stackframe) every time I call `sniff', like if
that has been declared static. I am just wondering if there's a way to
declare INDEXFL, so every time `sniff' is called, the memory for the variable
will be allocated.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 27 Oct 1999 19:50:12 +0900
From: "Yeong Mo/Director Hana co." <hmaster@factory.co.kr>
Subject: How to divide output records per page ?
Message-Id: <GR8YQvSI$GA.242@news.thrunet.com>
Hi,
How to divide output records per page Like every search engine does ?
What is the basic ?
Thanks in advance.
------------------------------
Date: 28 Oct 1999 03:52:52 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How to get the system time??
Message-Id: <slrn81g3m7.66b.abigail@alexandra.delanet.com>
Abel Almazán (abel.almazan@ogilvyinteractive.es) wrote on MMCCXL
September MCMXCIII in <URL:news:380C4D6C.FC213F2B@ogilvyinteractive.es>:
,, I want to get the system time, if it's possible in the format :
,,
,, hh:mm:ss
,,
,, How can i do?? Exists a system call??
No. Impossible in Perl. If it was, you would have found it in the
manual, wouldn't you? Just the fact you didn't find it there means
it isn't there.
You would have to use C.
Abigail
--
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
"\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
"\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Thu, 28 Oct 1999 10:14:17 +0200
From: "XeoN" <xeon@g-em.com>
Subject: Re: HTML::Parser
Message-Id: <7v90lb$17c5$1@news.ipartners.pl>
Baris Sumengen <sumengen@hotelspectra.com> wrote in message
news:7v85s0$crs$1@bgtnsc02.worldnet.att.net...
> Why don't you share it with us.
> Baris.
>
Here it is.
XeoN
{
package myParser;
use HTML::Parser;
@myParser::ISA = qw(HTML::Parser);
sub new {
my $class = shift;
my $self = $class->SUPER::new;
$self->{myText} = '';
bless $self, $class;
}
sub text {
my ($self, $text) = @_;
$self->{myText} .= $text;
}
}
package main;
my $hmtl2txt = new myParser;
$hmtl2txt->parse($doc);
$content=$hmtl2txt->{myText};
------------------------------
Date: 28 Oct 1999 09:32:08 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: HTML::Parser
Message-Id: <38180a08_1@newsread3.dircon.co.uk>
David Cassell <cassell@mail.cor.epa.gov> wrote:
> Tom Phoenix wrote:
>>
>> Perlite?
>
> Sure. I've been using the term here for nearly a year, and
> it still hasn't caught on. Goes with 'Perlish', don't you think?
>
I thought that is was a substance that was harmful to Perl programmers.
/J\
--
"Conservatives have called on Sports Minister, Tony Banks, to resign
after calling William Hague a foetus" - BBC News Website
------------------------------
Date: 28 Oct 1999 03:59:06 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Ignore the idiots
Message-Id: <slrn81g41t.66b.abigail@alexandra.delanet.com>
Csaba Raduly (csaba.raduly@sophos.com) wrote on MMCCXL September MCMXCIII
in <URL:news:380C353F.81536CE2@sophos.com>:
''
'' Btw Abigail, your
''
'' srand 123456;$-=rand$_--=>
''
'' thingy came up with
''
'' r nlkerJtherPct aeHa suo
''
'' Could it be that your rand and mine work in different ways ?
Mine was written for Solaris.
Abigail
--
perl -we '$_ = q ;4a75737420616e6f74686572205065726c204861636b65720as;;
for (s;s;s;s;s;s;s;s;s;s;s;s)
{s;(..)s?;qq qprint chr 0x$1 and \161 ssq;excess;}'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Thu, 28 Oct 1999 07:54:52 GMT
From: greg@mccarroll.demon.co.uk (Greg McCarroll)
Subject: Re: Is Perl a good language for making text-based games? If not, what is?
Message-Id: <3817ff93.6036000@newspull.london1.eu.level3.net>
On 27 Oct 1999 20:52:08 -0000, Jonathan Stowe
<gellyfish@gellyfish.com> wrote:
>On Wed, 27 Oct 1999 19:56:54 GMT George P. Masologites wrote:
>> I'm considering starting creation of a text-based game, in the style
>> of DragonRealms, GemStone III, Realms of Exile, or the various net
>> MUDs, MUSHs, etc. What programming language should I learn in order
>> to create something like this? I'm currently looking at:
>>
>Of course its Perl - you ought to check out the modules Games::Rezrov::*
>available from CPAN - this implements an Infocom game interpreter in
>Perl: there is an article about it in The Perl Journal #13 - you can
>get a back issue from <http://www.tpj.com>. (Hmm thats the second time
>in a week I've cited that issue - must be a good un :)
>
You have 3 main aspects to any MU* , first is text parsing, second is
data sharing and storage and third is networking. Perl is excellent at
all 3. The biggest challenge involved if you are going to try to write
a driver as good as a MudOS one is how you are going to implement
a secure equivalent of LPC[1] in Perl.
I was looking at doing something similar recently, so if you have any
questions please feel free to email me,
Greg
[1] LPC is a mini version of C that works on mud objects inside the
mud and can be compiled into and out of the driver at runtime.
------------------------------
Date: 28 Oct 1999 04:13:59 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Is Perl a good language for making text-based games? If not, what is?
Message-Id: <slrn81g4to.66b.abigail@alexandra.delanet.com>
George P. Masologites (guilds@mail.serve.com) wrote on MMCCXLVIII
September MCMXCIII in <URL:news:3817581d.304767603@news.mindspring.com>:
||
|| I'm considering starting creation of a text-based game, in the style
|| of DragonRealms, GemStone III, Realms of Exile, or the various net
|| MUDs, MUSHs, etc. What programming language should I learn in order
|| to create something like this? I'm currently looking at:
||
|| Perl
|| C/C++
|| BASIC/QBASIC
|| Java
|| Pascal
|| COBOL
||
|| and a few others as possible options. I don't think COBOL and Java
|| are meant for this type of thing, but as for the others, does anyone
|| have a particular recommendation? (I'm currently leaning towards
|| Perl.)
That depends a lot on what kind of game you want to make. If it's
like an LPmud, with many concurrent users, and many untrusted coders,
I wouldn't use Perl. Plain Perl for the game just gives coders just too
much rope to hang the entire game, and machine as well. And using Perl
for interpreting another language would just make things way to slow.
OTOH, Perl has many features that are very useful. Text based games
are, at large, a text-in, text-out system; an ideal task for Perl. I've
programmed a lot in LPC, but I haven't in years, because of its lack
of any decent string processing functions. Doing everything with sscanf
and explode is gruelsome.
But if you would make a single user game, Perl would be an excellent
choice. For a multiuser game, that isn't modifyable by untrusted coders,
it depends. Perl does have more overhead than C. And I've seen many
machines running LP drivers written in C at the brink of their capacity.
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 28 Oct 1999 04:33:40 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Is Perl a good language for making text-based games? If not, what is?
Message-Id: <slrn81g62m.66b.abigail@alexandra.delanet.com>
Greg McCarroll (greg@mccarroll.demon.co.uk) wrote on MMCCXLIX September
MCMXCIII in <URL:news:3817ff93.6036000@newspull.london1.eu.level3.net>:
..
.. You have 3 main aspects to any MU* , first is text parsing, second is
.. data sharing and storage and third is networking. Perl is excellent at
.. all 3. The biggest challenge involved if you are going to try to write
.. a driver as good as a MudOS one is how you are going to implement
.. a secure equivalent of LPC[1] in Perl.
*cough* *cough* *cough*
"A driver as good as MudOS", that sounds even more rediculious than
"An OS as good as Windows". The fact that MudOS and MSDOS only differ
by one letter cannot be a coincidence.
If you want an LP driver, nothing comes remotely close to DGD.
Abigail
--
perl -we '$_ = q ?4a75737420616e6f74686572205065726c204861636b65720as?;??;
for (??;(??)x??;??)
{??;s;(..)s?;qq ?print chr 0x$1 and \161 ss?;excess;??}'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Thu, 28 Oct 1999 10:20:44 +0300
From: Anttoni Huhtala <Anttoni@iname.com>
Subject: is there a Perl module for checksum (or CRS)?
Message-Id: <3817F94C.8FE3BA65@iname.com>
Hi.
Is there a module for CRS?
just a smiple one would do...cheking date and bytesize...
(and comparing it to an other file would just be great!)
But just plain old CRS would do...
Anttoni Huhtala
------------------------------
Date: 28 Oct 1999 03:38:21 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: linking to perl script to html page.
Message-Id: <slrn81g2qv.66b.abigail@alexandra.delanet.com>
Tom Kralidis (tom.kralidis@ccrs.nrcanDOTgc.ca) wrote on MMCCXLVIII
September MCMXCIII in <URL:news:38177775.E4DEE683@ccrs.nrcanDOTgc.ca>:
!!
!! I want to make an existing html page a derived-cgi page, however, I
!! don't want people to update their links / bookmarks.
!!
!! The page lies at localhost:/http/docs/index.html
!!
!! I would like the address to stay the same, but for the file to point at:
!!
!! localhost:/http/cgi-bin/index.pl
!!
!! ..without a redirect, without the user knowing.
!!
!! Can this be done?
Of course. But, unless you are writing a server in Perl, what has
this to do with Perl?
Abigail
--
$_ = "\x3C\x3C\x45\x4F\x54\n" and s/<<EOT/<<EOT/ee and print;
"Just another Perl Hacker"
EOT
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Thu, 28 Oct 1999 08:35:32 GMT
From: ijg@connect.org.uk (I.J. Garlick)
Subject: Re: mod perl anomalies
Message-Id: <FKB178.IFr@csc.liv.ac.uk>
In article <GsFWRDAHBgF4EwSI@tnunn.demon.co.uk>,
Thomas Nunn <tom@tnunn.demon.co.uk> writes:
Firstly, I am a bit new at mod_perl stuff. I only just bought the
programming Apache in perl and C O'Reilly book and haven't tried to much
of it yet.
I have read most of it through though and have an idea what your problem
might be and who you can probably solve it yourself.
> However every so often when I submit the form, the record that is added
> to the file is actually a repetition of a record added a few submits
> before.
I think this is because you are accessing an Apache httpd that you have
accessed before which contains old info, ie. it's not been reset properly.
This happened to me when I first tried to use mod_perl (I just dived in
and tried to run before I had even relised crawling may have been a better
bet).
>
> I can see no pattern to this repetition, it just seems to randomly
> remember a string that was used a little while before.
Yep that's the clue that leads me too the above.
> So.. Anyone have any Idea what might be going on? I'm quite confused
> myself.
What you need to do is run restart your Apache web server with a special
command that limits it to only one daemon instead of 4 or 5. (I just read
about it, but can't remember the command). Once you get effectively only
one process to deal with it should be relatively easy to get debugging
info out and track down what's going on/wrong.
Sorry if I am a bit sparse on details but I have only jsut touched on this
stuff again very recently. I had worked out what was happening from my
previous brush with mod_perl but not how to solve it. Armed with this book
I am now starting to tackle it again.
HTH.
--
Ian J. Garlick
ijg@csc.liv.ac.uk
Tempt not a desperate man.
-- William Shakespeare, "Romeo and Juliet"
------------------------------
Date: Thu, 28 Oct 1999 03:51:06 -0500
From: Me <cklumb@bayou.\"ReMovE\"uh.edu>
Subject: MySQL RPM requires /usr/bin/perl5
Message-Id: <U5UR3.29787$7I4.664723@news5.giganews.com>
When I try to install MySQL server or client rpm. I get the warning
message "/usr/bin/perl5 required." I already have perl installed. In
/usr/bin I have: perl , perl5.00503 and perdoc. I tried to fix the
problem by creating a symbolic link named perl5 to perl5.00503 but that
did not work. Search engines and the perl website have not found useful
information for me. Any help would be appreciated.
Thanks
Johnny Bravo
P.S. If I use the rpm --nodeps or --force will this created problems?
------------------------------
Date: 28 Oct 1999 10:28:40 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Newbie: graphic counter:shes-a no work!
Message-Id: <38181748_1@newsread3.dircon.co.uk>
arami99@my-deja.com wrote:
>
> Just writing in to say Hello to everyone.
>
Right. And your reason for quoting the entire post was ?
/J\
--
"Nourishes at the root and penetrates right to the tip" - Pantene
Advertisement
------------------------------
Date: 28 Oct 1999 03:57:59 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: OT: Newsreader? a.k.a Re: Ignore the idiots
Message-Id: <slrn81g3vo.66b.abigail@alexandra.delanet.com>
Cameron Dorey (camerond@mail.uca.edu) wrote on MMCCXL September MCMXCIII
in <URL:news:380C6799.562B2A9A@mail.uca.edu>:
~~
~~ Martien Verbruggen wrote:
~~ >
~~ > Get some good newsreading software that can do article scoring. Score
~~ > some people positively, others negatively. Kill others totally. Set up
~~ > a list of subjects to kill or score negatively. Sort by score.
~~
~~ OK, you've got my curiosity piqued. What newsreader do you use?
Well, that answer can be found in his posting. Check his headers.
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 28 Oct 1999 03:40:22 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: POST data to a perl program, from a perl program
Message-Id: <slrn81g2up.66b.abigail@alexandra.delanet.com>
Max (nihilist@kenobiz.com) wrote on MMCCXLVIII September MCMXCIII in
<URL:news:381759d3.165735012@news.acronet.net>:
%% how can i send data via POST method from one perl script to another
%% without having to print any html code, just using strictly perl??
Well, have the second Perl script listen to a port, and implement
HTTP. Now, the first script can open a socket to said port, and
talk HTTP to the second script.
But why? Once you have 2 programs, it's a lot easier to call them
in various ways than to use HTTP.
Abigail
--
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Thu, 28 Oct 1999 07:38:30 GMT
From: bblishA@TblackbeltDO.Tcom (Ben Blish)
Subject: Re: Scripts that invoke one another via Location: and/or URI: - environment persistence?
Message-Id: <3817fb34.108360227@news.montanavision.net>
On Thu, 28 Oct 1999 06:22:35 GMT, mgjv@comdyn.com.au (Martien Verbruggen)
wrote:
>> Imagine a site where there are numerous places to visit. Imagine now that
>> there is a limited amount of manpower to enhance the site. Would it, or
>> would it not, be useful to know which pages are the msot heavily travelled?
>And normally, you get that information from access logs. They will
>tell you at least as much as a counter.
Martien,
Funny you should bring that up. :)
I have four websites hosted by ICOM; all four have CGI as part of the
low cost (ECCO) package at no extra charge. However, ICOM wants some
extra bucks to let you at the logfiles. So you've brought to mind the
perfect reason to code up counters - logfiles aren't always available.
It may even be more convenient, or inspiring, to look at the page in
particular with the counter on it as one contemplates more effort for
that page's content.
I hadn't thought of the access log problem until you brought it up, but
I just saw it the other day as I was signing up for a new website...
and thought something along the lines of "..don't need to pay for that,
I've got CGI." :-)
Thanks for the supporting instance!
--Ben
PS: I'm not saying that I think counters are the most wonderful thing in
the world - I was simply objecting to the blanket vitriol spilled on
the concept of flock()'ing data to implement counting (anything) by the
FAQ portion of the Perldocs, and by someone here a bit back.
>Martien
>--
>Martien Verbruggen |
>Interactive Media Division | Never hire a poor lawyer. Never buy
>Commercial Dynamics Pty. Ltd. | from a rich salesperson.
>NSW, Australia |
------------------------------
Date: Thu, 28 Oct 1999 08:05:04 GMT
From: bblishA@TblackbeltDO.Tcom (Ben Blish)
Subject: Re: Scripts that invoke one another via Location: and/or URI: - environment persistence?
Message-Id: <3817fd9b.108975456@news.montanavision.net>
On Thu, 28 Oct 1999 14:51:33 +0930, "Wyzelli" <wyzelli@yahoo.com> wrote:
re: parameters back and forth between .pl scripts
-------------------------------------------------
>I have just gone through something not entirely dissimilar, and found that
>printing a html form with hidden fields for the variables worked OK.
>Since that involved user input (do the form again) which you don't want,
>some sort of SSI type function to submit the form to script2.
I found that with Explorer, at least, you can just use Location: to send
the browser to another script. Netscape exihibited some cachelike
behaviours, I think it was treating the whole thing as a "GET" rather
than a "POST", so I've a little more work to do there (or a lot,
maybe. :-) I'd have really liked to use the query interface to pass
things, I've only got a few items to pass and they're all flags and
known strings... but the query interface is the GET interface, if I
understand it right (which again, could easily not be the case.)
Here's something like the incoming script, which would run because
a user clicked on a submit thingerizer:
-------------------
#
# Begin with some magic stuff to suck cookies from PERL environemnt
#
@nvpairs=split(/; /, $ENV{HTTP_COOKIE});
foreach $pair (@nvpairs)
{
($name, $value) = split(/=/, $pair);
$cookie{$name} = $value;
}
$cookiegrab = $cookie{'thscart'};
# now, we capture the state of the form:
# ...yadda...yadda
# with state captured, we need to test for cart:
#
# Based on cart cookie...
#
if ($cookiegrab ne "") # if (cart cookie isn't empty)
{ # then (we have a shopping cart)
# and can immediately process the form data
}
else # else (no cart available)
{
print "Set-cookie: cccheck=macadamia\n";
#
# in this next line, ideally, we'd send form state as a query: ?foo=bar
# but maybe it has to be as a POST thing on STDIN (or maybe I'll have
# to write temp files... talk about icky!!!)
#
print "Location: http://www.yaddayadda.com/cgi-bin/ccheck.pl\n\n";
}
--------------------------
Then the "checking script" does this:
#
# Begin with some magic stuff to suck cookies from PERL environemnt
#
@nvpairs=split(/; /, $ENV{HTTP_COOKIE});
foreach $pair (@nvpairs)
{
($name, $value) = split(/=/, $pair);
$cookie{$name} = $value;
}
$cookiegrab = $cookie{'cccheck'};
#
# Ideally, we'd have caught the query encoded state here...
#
#
# Then decide what to do based on test cookie
#
if ($cookiegrab eq "macadamia") # if (test cookie is present)
{ # then (we can make a cart for them)
# bunch of stuff to generate cart ID for cookie, then...
print "Set-cookie: thscart=$cartcount\n"; # and set the cookie.
# send browser BACK to cart parser, again, with data that looked like it
# came from the original form.
print "Location: http://www.yaddayadda.com/cgi-bin/scart.pl\n\n";
}
else # (we can't make a cart, so we whine about it...)
{
}
}
If I could figure out how to assure that a script would definitely
run when invoked by a Location: header to a browser, even though it
uses the query interface, I'd be all set. I've worked out how to
pass everything around and make my cookie check loop with all data
intact though both scripts, but only using the query interface. I'm
pretty sure you can do it thru STDIN, it's just not something I've
thought thru yet, much less tested.
> Maybe write a
>temporary shtml and write a location header with script1 which points to the
>shtml. That should auto submit the form with hidden fields, to script2 and
>something similar to come back to script1. Bit cumbersome, but it is the
>only way I can think of to achieve what you want.
I've printed this out and will definitely bear it in mind as I work through
the issues. Thank you very much for taking the time to read what I wrote
and then reply with a useful answer - very much appreciated!
--Ben
>
>Wyzelli
>
>
------------------------------
Date: 28 Oct 1999 03:46:58 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Scripts that invoke one another via Location: and/or URI: - environment persistence?
Message-Id: <slrn81g3b4.66b.abigail@alexandra.delanet.com>
Ben Blish (bblishA@TblackbeltDO.Tcom) wrote on MMCCXLIX September
MCMXCIII in <URL:news:3817fb34.108360227@news.montanavision.net>:
''
'' I have four websites hosted by ICOM; all four have CGI as part of the
'' low cost (ECCO) package at no extra charge. However, ICOM wants some
'' extra bucks to let you at the logfiles. So you've brought to mind the
'' perfect reason to code up counters - logfiles aren't always available.
Logfiles are, of course, always available. You just made a mistake by
using a service that doesn't give you want you want.
'' It may even be more convenient, or inspiring, to look at the page in
'' particular with the counter on it as one contemplates more effort for
'' that page's content.
Well, if a counter is signicificant to the content, I would leave the
page immediately - screaming.
This page has been visited 12319871298743216509217409218472640214 times
since 10 seconds ago!
Abigail
--
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 28 Oct 1999 10:56:30 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Scripts that invoke one another via Location: and/or URI: - environment persistence?
Message-Id: <38181dce_1@newsread3.dircon.co.uk>
Ben Blish <bblish@blackbelt.com> wrote:
>
> I know I can send the request. The question was, and is, how to feed them
> to Perl scripts in *particular* and how they are then accessed *in particular*.
> I got an email that was quite enlightening about how POST uses
> stdin and the POST uses the ?yadda=yadda query interface, which was exactly
> what I was asking, and again, which doesn't appear to be easily findable,
> or existant, in my copy of Perldocs.
This is not mentioned in the Perl documentation because it has nothing to
do with Perl. The CGI specification describes the mechanisms by which
parameters are to be passed to a program *whatever language it might be
written in* - if you are so overcome with false hubris that you must
reinvent the wheel and ignore the variety of modules that make working
with this specification simple then I would suggest that you start reading
that specification:
<http://hoohoo.ncsa.uiuc.edu/cgi>
And while you are at it you had better look at the CGI FAQ too:
<http://www.webthing.com/tutorials/cgifaq.html>
/J\
--
"I managed to take her completely by surprise" - Prince Edward
------------------------------
Date: 28 Oct 1999 03:33:51 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: What makes the web go?
Message-Id: <slrn81g2ih.66b.abigail@alexandra.delanet.com>
Martien Verbruggen (mgjv@comdyn.com.au) wrote on MMCCXLIX September
MCMXCIII in <URL:news:gUOR3.184$z73.4674@nsw.nnrp.telstra.net>:
__
__ *nod* They may be able to handle Yahoo. I don't know whether, given
__ enough hardware, MS SQL could perform well enough. But I know a few
__ things: The system would not be nearly as stable as Sybase on Solaris,
__ for example. And given the same investment, the latter would probably
__ outperform the MS solution by far. And if you then look at ASE on
__ Linux, which is a possibility as well nowadays,
*cough* On _Linux_? No, thanks.
To run a database in a large production environment, you need several
things. Good support for many processors. Technical support for your
server. And in the case of Sybase, raw devices.
AFAIK, Sybase 11.9.x isn't available on Linux yet - and for the 11.0.3.3
version, you cannot get support. Support that'll be dropped on other
platforms next year anyway (except VMS - they get another 4 years).
Abigail
--
tie $" => A; $, = " "; $\ = "\n"; @a = ("") x 2; print map {"@a"} 1 .. 4;
sub A::TIESCALAR {bless \my $A => A} # Yet Another silly JAPH by Abigail
sub A::FETCH {@q = qw /Just Another Perl Hacker/ unless @q; shift @q}
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 1209
**************************************