[11693] in Perl-Users-Digest
Perl-Users Digest, Issue: 5293 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Apr 3 22:07:27 1999
Date: Sat, 3 Apr 99 19:00:18 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 3 Apr 1999 Volume: 8 Number: 5293
Today's topics:
Re: Alternative for Perl <ebohlman@netcom.com>
Re: Alternative for Perl (Tad McClellan)
Can't get CGI script to execute UNIX Shell Script dworsham@usa.net
Re: Copy from Perl? <computerguru@mailexcite.com>
Re: Copy from Perl? (Tad McClellan)
Re: Copy from Perl? (Bob Trieger)
Re: Copy from Perl? <zenin@bawdycaste.org>
Date::Manip and pwd: cannot determine current directory (Bill Moseley)
Form Submission - Multi <bruce.d@btinternet.com>
fullpath() in perl? (William Herrera)
help perl win32 and personal web server <nic_azzuri@compuserve.com>
Re: help perl win32 and personal web server <gregm@well.com>
Re: help perl win32 and personal web server (Bob Trieger)
Re: help perl win32 and personal web server <JWDonline@FSBdial.co.uk>
Re: Help... Running Perl on NT slyde@hotmail.com
Re: I need help on cgi communication with layers. <gellyfish@gellyfish.com>
Perl and Windows NT RAS <jkhertog@worldnet.att.net>
Perl search script <saiidg@internetassociates.co.uk>
Re: printing in foreach (M.J.T. Guy)
Re: Reading /proc/meminfo using split /:/ <gavin@optus.net.au.dontspam.myass>
Re: Reading Graphics bradclawsie@my-dejanews.com
Real Time Chat Room <gp@gpcentre.net>
Re: Silicon Valley Perl Mongers? (Ran)
Re: Still stupid I guess. (Bob Trieger)
Re: Still stupid I guess. (Ran)
Re: Where could I find CGI.pm of Perl version 5.003? (Tad McClellan)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 3 Apr 1999 21:58:03 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Alternative for Perl
Message-Id: <ebohlmanF9Mvor.Knq@netcom.com>
Andrew M. Langmead <aml@world.std.com> wrote:
: Frank de Bot <debot@xs4all.nl> writes:
: >Is there an other language to replace perl, which is much faster?
: >Currently I have a database and I think when It's grown bigger, it will
: >ask too much of my computers capicity.
: If the code you use to access your data is O(n) or worse, you should
: re-think the algorithm.
Even if it's O(1), it's possible that the (1) is too big (for example, a
Web database application that's implemented on a
one-database-connection-per-hit basis).
------------------------------
Date: Sat, 3 Apr 1999 12:44:01 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Alternative for Perl
Message-Id: <11k5e7.bqi.ln@magna.metronet.com>
Eric Bohlman (ebohlman@netcom.com) wrote:
: Andrew M. Langmead <aml@world.std.com> wrote:
: : Frank de Bot <debot@xs4all.nl> writes:
: Even if it's O(1), it's possible that the (1) is too big (for example, a
: Web database application that's implemented on a
: one-database-connection-per-hit basis).
I'm sure you meant to say "the constant is too big" instead.
One can't get bigger and still be one :-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 03 Apr 1999 22:15:28 GMT
From: dworsham@usa.net
Subject: Can't get CGI script to execute UNIX Shell Script
Message-Id: <7e63tr$9kf$1@nnrp1.dejanews.com>
I am trying to make a simple form GUI to allow for the transfer of files
using existing, long proven csh scripts. I know this must be an easy one,
but I just can't seem to figure it out.
My problem is this:
I have no problem making the form, or parsing out the data, but I CAN NOT seem
to get the csh scripts to execute from the PERL5 cgi script. I have tried
using `scriptname`, open(SCRIPT, "| scriptname" ), and use Shell qw
(scriptname), all to no avail. I CAN do simple things like print the date to
the browser, or print back the submitted variables to the browser, I can even
execute a shell script that prints "Hello" back to the browser (although I
can't have that same script tee or redirect "Hello" to a file), But aside from
printing back to the browser my form has been useless. I am using the latest
version of APACHE on Linux, and have chmod the cgi-bin dir, and everything in
it to 777 (Security is not an issue at this point--I just need to see how this
works first).
I am certain that the problem is either in my cgi programming, or with
permissions, but I do not know what I am doing wrong. I have tried several
approaches to resolving this, but the key issue is that I have not been able
to write a cgi script that will successfully get a shell script to do more
than print something when submitted through a browser (IE 4.0). The same cgi
scripts run fine as regular PERL scripts, and execute the shell scripts then
(even if I su to nobody).
Therefore my question is this:
(Disregarding Security issues): How might I write a very simple cgi script
that would execute the following shell script when submitted through the
following form from a browser? Assuming that I have already parsed out the
variables.
Shell script:
#!/bin/csh
set file1=$1
set file2=$2
cp $file1 $file2
print "Files Copied" >> filecopy.log
HTML Form:
<HTML>
<HEAD>
<TITLE> File Copy Test-form</TITLE>
</HEAD>
<BODY>
<h2><B>This form is meant to be a simple interface for copying a file</h2></B>
<FORM METHOD=POST
ACTION="httpd://curley.stooges.com/cgi-bin/form.cgi">
<P>
Enter Original Filename Here: <INPUT TYPE="text" NAME="file1" SIZE=25>
<P>
Enter name for copied version? <INPUT TYPE="text" NAME="file2" SIZE=25>
<P>
<B>
<Center><INPUT TYPE=SUBMIT VALUE="Submit">
<INPUT TYPE=RESET VALUE="Clear">
</CENTER>
</FORM>
</BODY>
</HTML>
As I said before I am sure that the answer is probably something very simple,
but I just am not finding it.
I sincerely appreciate your help in resolving this. Thanks In Advance to
ALL!!!
Sincerely
Dennis Worsham
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sat, 3 Apr 1999 18:37:57 -0500
From: "Computer Guru Consulting" <computerguru@mailexcite.com>
Subject: Re: Copy from Perl?
Message-Id: <923182792.850.38@news.remarQ.com>
Hmmm....I figured a system call would work....alhough I don't know
modules....I've done very well w/o them :)
Modules are something I just can't grasp....just like any OOP, I can't grasp
it...I can do C, but not C++, And I always choke on the OOP concepts of Java
as well.....Thanks for your help
--
Computer Guru Consulting
Bringing your business to the world
http://www.cguru.com
Jonathan Stowe wrote in message <7e5dp9$7c$1@gellyfish.btinternet.com>...
|On Sat, 3 Apr 1999 09:49:41 -0500 Computer Guru Consulting wrote:
|>
|> Hello
|> I have a simple(?) question...
|> I am trying to copy the contenys of test.txt to test.dat...
|> In unix I simply do this
|> cp test.txt test.dat
|> How do I do this in Perl? Thanks
|
|What ways have you tried ?
|
|File::Copy is a widely touted solution (it comes with Perl) although
|there is no harm in doing:
|
|system('cp','text.txt','text.dat');
|
|/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: Sat, 3 Apr 1999 13:16:55 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Copy from Perl?
Message-Id: <nul5e7.uri.ln@magna.metronet.com>
Computer Guru Consulting (computerguru@mailexcite.com) wrote:
: Modules are something I just can't grasp....
: just like any OOP, I can't grasp
: it...I can do C, but not C++, And I always choke on the OOP concepts of Java
: as well.....Thanks for your help
: --
: Computer Guru Consulting
^^^^
In that case, you seem a little pretentious with your choice
of title there...
:-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 04 Apr 1999 00:50:09 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Copy from Perl?
Message-Id: <7e6cu3$ogt$1@birch.prod.itd.earthlink.net>
"Computer Guru Consulting" <cguru@hotpop.com> wrote:
o>Hmmm....I figured a system call would work....alhough I don't know
o>modules....I've done very well w/o them :)
o>Modules are something I just can't grasp....just like any OOP, I can't grasp
o>it...I can do C, but not C++, And I always choke on the OOP concepts of Java
o>as well.....Thanks for your help
Ask the computer guru whose account you are using to tutor you.
You don't have to know all of the inner workings of OO to use the modules.
Most of them come with great documentation on how to use them. Not using the
modules provided is like not driving because you don't under gas combustion.
Bob Trieger
sowmaster@juicepigs.com
"Contrary to popular belief, man can live on Ramen Noodles alone"
------------------------------
Date: 04 Apr 1999 01:01:47 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Copy from Perl?
Message-Id: <923187772.993939@thrush.omix.com>
Computer Guru Consulting <computerguru@mailexcite.com> wrote:
: Hmmm....I figured a system call would work....alhough I don't know
: modules....I've done very well w/o them :) Modules are something I just
: can't grasp....just like any OOP, I can't grasp it...I can do C, but not
: C++, And I always choke on the OOP concepts of Java as well.....Thanks for
: your help
In that case you'll be pleasantly surprised to learn that the
File::Copy module isn't OO at all. It's entirely basic procedural
programming.
--
-Zenin (zenin@archive.rhps.org)
Yah, Emacs is a good OS, but I prefer FreeBSD.
------------------------------
Date: Sat, 3 Apr 1999 18:44:47 -0800
From: moseley@best.com (Bill Moseley)
Subject: Date::Manip and pwd: cannot determine current directory!
Message-Id: <MPG.117071f8d4936faa989706@206.184.139.132>
I'm using Date::Manip::ParseDate to convert a string date to unix time.
When running as a CGI script and calling ParseDate I get the error
pwd: cannot determine current directory!
written to my STDERR. ParseDate is the only part of Manip that I'm
using. Any ideas what's going on?
Date::Manip -> # Version 5.30 01/20/98
Here's the STDERR output:
Before call to ParseDate
pwd: cannot determine current directory!
After call to ParseDate
And here's where I call ParseDate:
#========== String to epoch ==========================
use Time::Local; # Because Date::Manip UnixDate doesn't
# seem to work across DST times
# To convert string entered dates
use autouse 'Date::Manip' => qw( ParseDate );
sub string_to_unix_time {
my $string = shift;
print STDERR "Before call to ParseDate\n";
if ($string && ($string = ParseDate( $string )) ) {
my ($year, $mon, $mday, $hours, $dummy, $min, $dummy, $sec) =
unpack("a4 a2 a2 a2 a a2 a a2", $string);
print STDERR "After call to ParseDate\n";
return timelocal($sec,$min,$hours,$mday,--$mon,$year-1900);
}
print STDERR "No date passed or ParseDate Failed\n";
return 0;
}
--
Bill Moseley mailto:moseley@best.com
------------------------------
Date: Sun, 4 Apr 1999 00:06:48 +0100
From: "Bruce Davidson" <bruce.d@btinternet.com>
Subject: Form Submission - Multi
Message-Id: <7e66hu$hoo$1@uranium.btinternet.com>
Is there any way to submit the variables from one cgi generated form to two
different scripts which occupy two different frames.
Thanks
------------------------------
Date: Sat, 03 Apr 1999 22:00:51 GMT
From: posting.account@lynxview.com (William Herrera)
Subject: fullpath() in perl?
Message-Id: <37068e9e.1408432185@news.rmi.net>
I there an equivalent to C fullpath() in perl?
I mean somthing that adds the full path to a filename, performing some
canonpath() style cleanup along the way, as in changing
"myfile.txt"
to
"/usr/text/myfile.txt"
or in win32 to
"c:\\user\\myfile.txt"
(No, canonpath() in File::spec won't do this. Maybe it's broken?)
---
The above from: address is spamblocked. Use wherrera (at) lynxview (dot) com for the reply address.
------------------------------
Date: Sat, 3 Apr 1999 22:57:08 +0100
From: "MarcoPolo" <nic_azzuri@compuserve.com>
Subject: help perl win32 and personal web server
Message-Id: <OxZ5f1hf#GA.349@nih2naad.prod2.compuserve.com>
hi i am new to perl and hav erecently installed on to my pc. I have a peer
to peer net work set up and am having difficulty in getting perl to work to
run from html documanets, even a simple cgi post script will not execute
properly, it gives an error something like :
http error 405
405 method not allowed
then goes on about request files and MIME's
Any help would be appreciated
marcopolo
------------------------------
Date: Sat, 03 Apr 1999 14:36:27 -0800
From: Greg McCann <gregm@well.com>
Subject: Re: help perl win32 and personal web server
Message-Id: <370697EB.D08F3A55@well.com>
See your web server's documentation for configuring it to run CGI
applications.
Greg
MarcoPolo wrote:
>
> hi i am new to perl and hav erecently installed on to my pc. I have a peer
> to peer net work set up and am having difficulty in getting perl to work to
> run from html documanets, even a simple cgi post script will not execute
> properly, it gives an error something like :
>
> http error 405
>
> 405 method not allowed
>
> then goes on about request files and MIME's
>
> Any help would be appreciated
>
> marcopolo
--
======================
Gregory McCann
http://www.calypteanna.com
"Be kind, for everyone you meet is fighting a great battle." Saint
Philo of Alexandria
------------------------------
Date: Sat, 03 Apr 1999 22:28:04 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: help perl win32 and personal web server
Message-Id: <7e64j7$dge$1@birch.prod.itd.earthlink.net>
In article <OxZ5f1hf#GA.349@nih2naad.prod2.compuserve.com>, "MarcoPolo" <nic_azzuri@compuserve.com> wrote:
o>hi i am new to perl and hav erecently installed on to my pc. I have a peer
o>to peer net work set up and am having difficulty in getting perl to work to
o>run from html documanets, even a simple cgi post script will not execute
o>properly, it gives an error something like :
>
o>http error 405
o>
o>405 method not allowed
That 405 error is an http error, not a perl error. Check the docs for proper
configuration of your webserver. If you can't find the answer there, try a
webserver newsgroup.
Good luck,
Bob Trieger
sowmaster@juicepigs.com
------------------------------
Date: Sat, 03 Apr 1999 23:47:05 +0100
From: John Wills <JWDonline@FSBdial.co.uk>
Subject: Re: help perl win32 and personal web server
Message-Id: <37069A69.60D2CBA0@FSBdial.co.uk>
Marco
Do you have you cgi-bin aliased correctly in your www server properties? Have
you told your web server where to find Perl.exe on the servers hard drive?
Check they are correct, if they are then make sure your PERL scripts have the
*.pl extension and are in the cgi-bin, I have had problems with *.cgi
extensions on Win32 and find that *.pl works fine.
Regards
John
MarcoPolo wrote:
> hi i am new to perl and hav erecently installed on to my pc. I have a peer
> to peer net work set up and am having difficulty in getting perl to work to
> run from html documanets, even a simple cgi post script will not execute
> properly, it gives an error something like :
>
> http error 405
>
> 405 method not allowed
>
> then goes on about request files and MIME's
>
> Any help would be appreciated
>
> marcopolo
------------------------------
Date: Sun, 04 Apr 1999 02:10:34 GMT
From: slyde@hotmail.com
Subject: Re: Help... Running Perl on NT
Message-Id: <7e6hmn$kd6$1@nnrp1.dejanews.com>
In article <37026870$0$8073@pascal>,
"F." <fvdm@dds.nl> wrote:
> Open regedit and follow this path:
> HKEY_LOCAL_MACHINE, System, CurrentControlSet, Services, W3svc, Parameters,
> ScriptMap
>
> Then add this string value in your register:
> .pl
>
> With this value:
> path/to/perl.exe "%s" "%s"
>
> Restart your PC.
>
> I hope this helps,
>
> Frank.
Would this be also applicable to Windows 98 PWS?
Thanks.
Slyde
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 3 Apr 1999 21:36:39 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: I need help on cgi communication with layers.
Message-Id: <7e61l8$ml$1@gellyfish.btinternet.com>
On Sat, 03 Apr 1999 11:32:56 -0600 William Tammen wrote:
> <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
> <html>
>
> <center><b><font size=+3>Attention</font></b></center>
> I do not want free programming, I would love to hear from anyone who gets
Again.
It is not considered to be in good taste to post in HTML and your request
is possibly off -topic for this newsgroup however I did not read it all
because of the fact that it was made difficult to read by being thus
burdened.
/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: 3 Apr 1999 23:59:51 GMT
From: "Justin K. Hertog" <jkhertog@worldnet.att.net>
Subject: Perl and Windows NT RAS
Message-Id: <01be7e2d$5bfba880$3c064f0c@WHPL-HertogJ.conedsolutions.com>
Does anyone know a way to schedule RAS to dial to a phonebook entry and
download a file via FTP. How could this be done? I'm interested in
scripted solutions mostly (WSH, Perl, VBScript, etc.)
Thank You,
Justin.
------------------------------
Date: Sat, 3 Apr 1999 23:18:24 +0100
From: "Saiid Ghobadian" <saiidg@internetassociates.co.uk>
Subject: Perl search script
Message-Id: <923177889.8394.0.nnrp-08.d4e4e80b@news.demon.co.uk>
I am trying to write a perl search script that lists files, opens them and
searches their contents. I seem to
be having trouble with this section of
code which cds into the base directory and does an ls to see what files are
in there:
chdir($basedir);
foreach $file (@files) {
$ls = `ls $file`;
etc.
but the script only ever sees this sort of structure
/www/cgi-bin/ww....etc....co.uk
instead of /home/joe/...etc
and is therefore failing because it cannot cd to the directory. What can I
do about
this?
Thanks in advance.
------------------------------
Date: 3 Apr 1999 23:07:50 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: printing in foreach
Message-Id: <7e6706$29v$1@pegasus.csx.cam.ac.uk>
Wayne Collins <collinw@netinc.ca> wrote:
>The code below prints . . .
>5
>4
>3
>2
>1
>BOOM!
>. . . with a 1 second pause after each item.
>foreach $count (5, 4, 3, 2, 1, 'BOOM!')
>{
> print $count, "\n";
> sleep (1);
>}
>
>If I change the code to this . . .
>foreach $count (5, 4, 3, 2, 1, 'BOOM!')
>{
> print $count;
> sleep (1);
>}
>print "\n";
>There is a six second pause and then the entire line is printed. It
>appears the newline character is required to get something to the
>screen. Can anyone explain that? Merci.
See the $| variable in the perlvar man page.
Mike Guy
------------------------------
Date: Sat, 03 Apr 1999 22:54:17 GMT
From: Gavin Cato <gavin@optus.net.au.dontspam.myass>
Subject: Re: Reading /proc/meminfo using split /:/
Message-Id: <923179731.417690010@news0.optus.net.au>
Thanks tons that did the trick.
Interesting code example as well good to see your brain is still in 1st :=
-)
Cheers,
Gavin
Jonathan Stowe <gellyfish@gellyfish.com> wrote:
>On Sat, 03 Apr 1999 08:33:32 GMT Gavin Cato wrote:
>> Hello All,
>>=20
>> newbie perl prob :-)
>>=20
>> I'm trying to read /proc/meminfo on a linux system and grabbing the me=
mtotal
>> field
>>=20
>> I'm using
>>=20
>> open(MEMORY, "<$memtotal");
>
>Always check the success of the open.
>
>> while (<MEMORY>) {
>> if (/MemTotal/) {
>> $memtemp =3D(split/:/) [1];
>
>you could use:
> $memtemp =3D (split(/:\s+/))[1];
>
>to get rid of the extra whitespace.
>
>> print $memtemp;
>> }
>> }
>>=20
>
>Anyhow for some reason this tickled my fancy and as I needed to check if
>the brain was still in gear and just for fun of course is a little thing
>that will put the contents of /proc/meminfo into a couple of hashes for
>later use:
>
>
>#!/usr/bin/perl -w
>
>use strict;
>
>my $meminfo =3D '/proc/meminfo';
>
>my %summary ;
>my %detail =3D ();
>
>open(MEMINFO,$meminfo) || die "Can't open $meminfo - $!\n";
>
>my $categories =3D <MEMINFO>;
>
>chomp $categories;
>
>my @cats =3D ($categories =3D~ /(\w+):/g);
>
>for ( 1 .. 2 )
> {
> my $index =3D 0;
>
> my ($key,$values) =3D split /:/,<MEMINFO>;
>
>
> my @value =3D split ' ', $values;
>
> foreach (@value)
> {
> $summary{$key}->{$cats[$index++]} =3D $_;
> }
> =20
>}
>
>my ($type,$blah);
>
>foreach $type (keys %summary)
>{
>
> foreach $blah ( keys %{$summary{$type}} )
> {
> print "$type $blah $summary{$type}->{$blah}\n";
> }
>}
>
>while(<MEMINFO>)
>{
> chomp;
> if ( /^(\w+):\s+(\d+)/ )
> {
> $detail{$1} =3D $2;
> }
>}
>
>foreach (keys %detail)
>{
> print "$_ $detail{$_}\n";
>}
>
>close MEMINFO;
>
>
>I cannot guarantee that this will work on anything other than :
>
>Linux gellyfish 2.2.0 #3 Sat Mar 13 15:43:01 GMT 1999 i686 unknown
>
>However.
>
>/J\
>--=20
>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/Has=
tings>
------------------------------
Date: Sat, 03 Apr 1999 22:28:37 GMT
From: bradclawsie@my-dejanews.com
Subject: Re: Reading Graphics
Message-Id: <7e64me$a4f$1@nnrp1.dejanews.com>
In article <7e5jg4$otb$1@goof.de.uu.net>,
"Thomas Schwanhduser" <Thomas@aps.de> wrote:
> Hi,
>
> I want to check if several servers are online. To do this I want to run a
> Perl-Script who should load http://www.domain1.com/images/picture.gif,
> http://www.domain2.com/images/picture.gif .... and so on
You have to do two things:
1) Make sure the url is valid. The LWP package will do this for you:
use LWP::Simple;
&LWP::Simple::head($url)
allows you to see if the url is valid - if so, you can also check the HTTP
header to determine if the file is of non-zero size.
2) Obtain the data, and determine if it is valid. By this, I mean, you want to
determine that the file is actually a GIF image. I am not sure if this step is
required in your application, but your message eluded to it.
You may also want to check the last-modified date in the HTTP return data to
determine if the timestamp is in line with your requirements.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sat, 03 Apr 1999 19:57:29 -0700
From: Philip Gabbert <gp@gpcentre.net>
Subject: Real Time Chat Room
Message-Id: <030419991957298294%gp@gpcentre.net>
I'm trying to create a 'real' time chat room. You know one of the ones
where the frame withthe messages is constantly loading, and printing
news messages as they appear in the Chat room data file..
I've gotten the script to work like a champ on a Linux system, but I
can't for the love of me get the script to work via Netscape..
Any ideas?
Now, the contast loop in the script will run fine on the command line,
but Netscape like tries to read the extire script output before ever
printing anything to the screen.
Is there a way i can 'force' Netscape to print the output as it comes?
If so how? I'm totally baffeled, and every chat room I can find on CGI
Resources that's created using Perl costs, and I can't view thier
source to see how they have done it..
Can Anybody help? I'm really lost?
Thanx..
Philip
PS: If you need to see my source code for what i have done, please
emial me privatly
PPS: I'm already using the buffer-flushing ($| = 1)
------------------------------
Date: Sun, 04 Apr 1999 02:50:56 GMT
From: ran@netgate.net (Ran)
Subject: Re: Silicon Valley Perl Mongers?
Message-Id: <923194256.235.28@news.remarQ.com>
In <7e493k$rk1$1@nnrp1.dejanews.com>, hwy280@yahoo.com writes:
>Please correct if I'm wrong. But I find it really strange that there
>is NO Perl user group in Silicon Valley, where the use of Perl is
>everywhere and created such enormous wealth, and where I believe
>LW lives. Why is that? :-)
>From the home office in Alviso, the Top 10 Reasons That There's no Perl
Mongers Group in Silicon Valley":
10. Every techie in the Valley has dedicated net access, so we do all
our interpersonal interaction online.
7. Perl doesn't *need* to be mongered here.
6. The only sufficiently-neutral location for meetings is the center
of the Dunbarton Bridge, and there's no decent parking there.
5. We're all too busy creating "enormous wealth" to socialize.
4. Sun threatened to move to Beaverton if any scripting language
other than Tcl were allowed to have an official users' group here.
3. Previous attempts to form a group failed, because representatives
of Nancy Kwan kept disrupting the meetings by trying to recruit
everyone to sell anti-aging cream.
2. Larry was afraid his great personal charisma might cause a cult to
form, and he didn't want to risk any ghoulish newspaper headlines
about "The Perltown Tragedy".
And ... the Number One Reason is....
1. There is one, but nobody's allowed to tell *you* about it.
Ran
------------------------------
Date: Sat, 03 Apr 1999 22:01:07 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Still stupid I guess.
Message-Id: <7e630n$bba$1@birch.prod.itd.earthlink.net>
sweet@enterpriseusa.com (Rob Sweet) wrote:
>
>Thanks for the advice, but I'm still a bit stuck...
>
>What I need to do is have a script programatically fill in the form at
>www.yahoo.com and "click" submit.
>
>Maybe LWP can do this... but I've been a good boy, I've read the docs,
>I've searched Deja News, and I'm still not making any progress.
Take a deep breath and relax, sounds like you can't see the forest through the
trees and I know that feeling when I try too hard to do something very
simple. The lwp doc has an example of exactly what you are trying to
accomplish.
This is copied straight from the lwp docs:
=========
This example shows how the user agent, a request and a response are
represented in actual perl code:
# Create a user agent object
use LWP::UserAgent;
$ua = new LWP::UserAgent;
$ua->agent("AgentName/0.1 " . $ua->agent);
# Create a request
my $req = new HTTP::Request POST =>
'http://www.perl.com/cgi-bin/BugGlimpse';
$req->content_type('application/x-www-form-urlencoded');
$req->content('match=www&errors=0');
# Pass request to the user agent and get a response back
my $res = $ua->request($req);
# Check the outcome of the response
if ($res->is_success) {
print $res->content;
} else {
print "Bad luck this time\n";
}
==========
Throw a tag line on that, change the url and content lines and you have your
solution.
May I also suggest that you pick up a copy of Tom and Nat's "Perl Cookbook"
published by O'Reilly? It has even better examples of this and just about
everything else.
Bob Trieger
sowmaster@juicepigs.com
------------------------------
Date: Sun, 04 Apr 1999 02:49:42 GMT
From: ran@netgate.net (Ran)
Subject: Re: Still stupid I guess.
Message-Id: <923194182.619.59@news.remarQ.com>
In <37063fa5.23558319@news.msen.com>, sweet@enterpriseusa.com (Rob Sweet) writes:
>I know how to use LWP to automatically POST data to
>http://search.yahoo.com/bin/search, with a value in "p". But that's
>not what I need to do. :)
>
>What I need to do is have a script programatically fill in the form at
>www.yahoo.com and "click" submit.
>From the point of view of the underlying client-server code, those
actions are identical.
*Iff* the structure of the form remains constant, of course. Is this
the source of the confusion about your question?
Is the problem here that you want to fetch the webpage with the form,
and have the program emulate a human operator, jumping from field to
field and typing in values? Without having the program "know" what the
fieldnames and other internals of the form look like?
If so, I think what you want to do is find the source for a web browser
with forms support, and hack it to support some simple scripting.
Or maybe you could do something with any old browser and expect? If you
don't need platform independence, you could also send window messages
to the browser app with keystrokes in them. As luck would have it, you
don't even have to mess with fake mouse events: just send a fake
"Enter" keypress. This method does have a synchronization problem that
might be hard to solve: you have to know when the webpage is in the
browser window, and ready for you to start "typing" into it.
HTH.
Ran
------------------------------
Date: Sat, 3 Apr 1999 12:50:44 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Where could I find CGI.pm of Perl version 5.003?
Message-Id: <kdk5e7.bqi.ln@magna.metronet.com>
Francois Luneau (fluneau@viconics.com) wrote:
: I only have 5.004 or higher available to me...
Then your system is vulnerable to being cracked.
Better backup then remove your sensitive files before
someone finds out (particularly since the whole world
now knows that you are vulnerable).
See http://www.cert.org/advisories/ if you want more info.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 5293
**************************************