[10726] in Perl-Users-Digest
Perl-Users Digest, Issue: 4325 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 30 15:07:38 1998
Date: Mon, 30 Nov 98 12:00:25 -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 Mon, 30 Nov 1998 Volume: 8 Number: 4325
Today's topics:
Re: CGI-Scripts <dales@enhanced-performance.com>
Re: CGI-Scripts (Kenneth)
Re: Checking site status (brian d foy)
Cut And Paste Application on the web? <winframe@iname.com>
Re: Cut And Paste Application on the web? <rootbeer@teleport.com>
Re: Cut And Paste Application on the web? <jeromeo@atrieva.com>
Re: Date file created check? <rootbeer@teleport.com>
Re: Date file created check? (Tad McClellan)
Re: Date file created check? (Larry Rosler)
Re: Date file created check? (Peter J. Kernan)
Re: Difficult Pattern Matching (Andrew Allen)
Re: embedded while loop problem <ebohlman@netcom.com>
Re: Encryption <rootbeer@teleport.com>
Re: Folder Recurison <r28629@email.sps.mot.com>
FTP transfers, was Re: Please help me solve three CGI p <flavell@mail.cern.ch>
Re: Input from <TEXTAREA> via perl and DBI into MySQL d (brian d foy)
Re: Input from <TEXTAREA> via perl and DBI into MySQL d <rootbeer@teleport.com>
re: LWP::UserAgent leaks memory? weinerk@usa.net
Multiplayer Roleplaying Game, Web-Based, Written in Per wyndo@cxo.com
Re: Multiplayer Roleplaying Game, Web-Based, Written in (Noel Llopis)
Re: Perl CGI 500 Server Error on PWS <pulsecode@mailandnews.dot.com>
Perl CGI program <xiaop@sbu.ac.uk>
Re: Perl CGI program <cgormley@netcomuk.co.uk>
Re: Perl CGI program <rootbeer@teleport.com>
Re: perl Tk dturley@pobox.com
Perl to awk? <watsiyem@vt.edu>
Re: Perl to awk? <rootbeer@teleport.com>
Perl5.005 in HP-UNIX? (EXCHANGE:MTL:1T83)
Reference to eval'd code theorb@my-dejanews.com
Re: Reference to eval'd code <rootbeer@teleport.com>
Re: single quote problems (Greg Ward)
Re: single quote problems (Andrew Allen)
Use of uninitialized value with $ARGV[0] ?? <neelam@healtheon.com>
Re: Use of uninitialized value with $ARGV[0] ?? <rootbeer@teleport.com>
Re: variables in substitutions rick.schwein@phillynews.com
Re: When does CLOSE not FLUSH? <rootbeer@teleport.com>
Re: When does CLOSE not FLUSH? <cgormley@netcomuk.co.uk>
Re: When does CLOSE not FLUSH? <rootbeer@teleport.com>
Re: Win16 DLL access (on NT) Help!!! <tripp.lilley@perspex.com>
Re: Y2K and Programmer Denial (Larry Rosler)
Re: Y2K and Programmer Denial (Craig Berry)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 30 Nov 1998 11:00:41 -0800
From: Dale Sutcliffe <dales@enhanced-performance.com>
Subject: Re: CGI-Scripts
Message-Id: <3662EB59.F5BA07AE@enhanced-performance.com>
Most ISPs will allow you to run cgi-scripts after you email them the script, they will inspect the script for potential security problems, and then
set the script to execute if everything looks ok.
But first you need to create and test the script on your own system.
I like Microsoft's personal web server which can be downloaded from:
"http://www.microsoft.com/windows/ie/pws/default.htm?/windows/ie/pws/main.htm"
Instructions on setting up perl to run with pws are at:
http://www.DynamicNet.net/support/fp/perlwithPWS.htm
However, my ISP uses Apache on a unix machine. (There are few slight differences between perl on Windows and Unix, ie, file locking.)
So you can download Apache for windows at "www.apache.org"
Good luck.
------------------------------
Date: Mon, 30 Nov 1998 19:19:52 GMT
From: emailken@yahoo.com (Kenneth)
Subject: Re: CGI-Scripts
Message-Id: <73ur9h$scq$1@hfc.hk.super.net>
In article <73f3kb$ljl$1@news.vossnet.de>, "Heiko" <HeikoR@vossnet.de> wrote:
>Hi there!
>
>I4m working on my own CGI-Scripts but I can4t find a server on which I can
>freely execute my own scripts. So, are there any servers like that
>available?
>
>Bye bye,
> Heiko
Ooooo,
I've encountered several free servers which allows CGI services.
1. Korean based http://free.xtel.com/
2. Hong Kong Cybercity http://www.cybercity.hko.net/ or the Freenations
3. SDF Lonestar Public server. http://sdf.lonestar.org/
Kenneth
------------------------------
Date: Mon, 30 Nov 1998 13:06:30 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Checking site status
Message-Id: <comdog-ya02408000R3011981306300001@news.panix.com>
In article <RrA82.24333$8G5.7196@news.cwix.com>, "Norman Bunn" <norman.bunn@mci.com> posted:
> I need to check whether certain web sites and FTP servers are up on a
> regular basis. Any thoughts on the "best" approach to take with Perl?
LWP. or use the free service by Philip Greenspun.
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Tue, 1 Dec 1998 02:19:07 +0800
From: "VB BV" <winframe@iname.com>
Subject: Cut And Paste Application on the web?
Message-Id: <73uncs$m8c@ustsu10.ust.hk>
HI,
I need to develop an application whereby the user on a site can cut some
image from his computer (or COPY it, whatever) and paste it inside a textbox
in the page, and then send it across. Now, on my end I want that image to be
stored in a certain directory on my server, lets say http://www.xyz.com is
my server, then each image will be stored in, say, www.xyz.com/imagepost..,
and there will be rules for the what the name of the file would be, for
instance, if a user named John Travolta posts an image on 1december1998,
then the image name will johntravolta19981201 or something like that.
My concern is that TEXTAREA or textbox can only take text as input...I would
really really appreciate if someone could recommend a way which this can be
done. Will I have to develop an ActiveX application for this?
Please email to me also.
Thanks for your time, I really do appreciate it.
Best regards,
VB BV
------------------------------
Date: Mon, 30 Nov 1998 19:18:28 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Cut And Paste Application on the web?
Message-Id: <Pine.GSO.4.02A.9811301117410.19172-100000@user2.teleport.com>
On Tue, 1 Dec 1998, VB BV wrote:
> I need to develop an application whereby the user on a site can cut
> some image from his computer (or COPY it, whatever) and paste it
> inside a textbox in the page, and then send it across.
Sounds as if you want the user's browser to be able to do this. Maybe the
docs, FAQs, and newsgroups about browsers and related issues could help
you here. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 30 Nov 1998 11:36:44 -0800
From: Jerome O'Neil <jeromeo@atrieva.com>
To: VB BV <winframe@iname.com>
Subject: Re: Cut And Paste Application on the web?
Message-Id: <3662F3CC.B768590@atrieva.com>
VB BV wrote:
> My concern is that TEXTAREA or textbox can only take text as input...I would
> really really appreciate if someone could recommend a way which this can be
> done. Will I have to develop an ActiveX application for this?
No, but you will need to check into file upload capability. This can be
done in perl using one of a couple of different modules available from
CPAN. I prefer CGI_Lite for this type of problem.
As far as your textbox, you will want to ask in one of the HTML related
newsgroups for the specifics, but I would suggest checking into the
<INPUT TYPE="file"> elements available on most newer browsers.
Good Luck!
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.atrieva.com
------------------------------
Date: Mon, 30 Nov 1998 18:04:28 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Date file created check?
Message-Id: <Pine.GSO.4.02A.9811301003000.26619-100000@user2.teleport.com>
On Mon, 30 Nov 1998, Dave Stephens wrote:
> Is there any way to do a check on the date a file was created?
Only if someone has stored that date somewhere. Most systems won't do that
for you, though, so you're probably out of luck. Oh well!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 30 Nov 1998 12:47:05 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Date file created check?
Message-Id: <97pu37.a2.ln@flash.net>
Dave Stephens (stepherd@gusun.georgetown.edu) wrote:
: Is there any way to do a check on the date a file was created?
No, because the filesystem itself does not store information
about when a file was created.
See stat() in the 'perlfunc' man page to find out what
information *is* available for a file.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 30 Nov 1998 10:38:44 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Date file created check?
Message-Id: <MPG.10cc86107347368b98989b@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <97pu37.a2.ln@flash.net> on Mon, 30 Nov 1998 12:47:05 -0600,
Tad McClellan <tadmc@flash.net> says...
> Dave Stephens (stepherd@gusun.georgetown.edu) wrote:
> : Is there any way to do a check on the date a file was created?
>
> No, because the filesystem itself does not store information
> about when a file was created.
By '*the* filesystem' I presume you mean '*a Unix-like* filesystem'. On
Windows/DOS machines, '*the* filesystem' does store that information.
> See stat() in the 'perlfunc' man page to find out what
> information *is* available for a file.
10 ctime inode change time (NOT creation time!) since the epoch
WROMG for Windows/DOS (no inodes, after all). I don't know about Macs
or other filesystems. Yes, there really *are* other filesystems. :-)
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 30 Nov 1998 19:24:11 GMT
From: pete@theory2.phys.cwru.edu (Peter J. Kernan)
Subject: Re: Date file created check?
Message-Id: <73urcr$b0e$1@alexander.INS.CWRU.Edu>
In article <3662CD38.605C7191@gusun.georgetown.edu>,
Dave Stephens <stepherd@gusun.georgetown.edu> writes:
[...snip...]
> Returns YEP if the file exists. Is there anything that will return the
> date whatever.txt was created on?
>
[...snip...]
$mtime = (stat("whatever.txt"))[9];
gives you the time stamp for the modification time, this might
be what you want, see
perldoc -f stat
--
Perl Envelopes Right Languages
open SIG, "<$ENV{HOME}/.sig" or die "sigless! $!";
$sig = do {local $/; <SIG>}; close SIG && print<<"$sig SIG";
Pete Kernan CWRU Physics and Statistics Depts
http://theory2.phys.cwru.edu/~pete
$sig SIG
------------------------------
Date: 30 Nov 1998 18:56:42 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: Difficult Pattern Matching
Message-Id: <73uppa$fbh@fcnews.fc.hp.com>
Erik van Roode (erik@cthulhu.demon.nl) wrote:
: Scott Brumley wrote:
: >
: > I want to do a pattern match on the common spam flag "$$$" However since
: > the $ character is an special anchor character I am having difficulty. I
: > thought I could use \$\$\$ but it does not seem to work either.
: After solving this problem, I have an interesting followup assignment:
: - write a script that does pattern matching to filter out duplicate
: messages (with possible different subject)
assuming a standard unix mail file (and assuming you don't mind a
shuffling of your mail file). Removes duplicate mail, ignoring headers
(all text from "From " to first "\n\n"), whitespace, and case;
open(MAIL,"<$ENV{MAIL}") or die "can't open mailfile $ENV{MAIL}: $!";
local $/;
$mail=<MAIL>;
@mails=split(/^From /m,$mail);
@mailkey=@mails;
foreach(@mailkey) {s/^.*?\n\n//s; s/\s+//g; $_=uc $_;}
@mail{@mailkey}=@mails;
print join("From ",values %mail);
Andrew
------------------------------
Date: Mon, 30 Nov 1998 17:52:49 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: embedded while loop problem
Message-Id: <ebohlmanF38xo1.Bpu@netcom.com>
Tad McClellan <tadmc@flash.net> wrote:
: Eric Bohlman (ebohlman@netcom.com) wrote:
: : ($key,$rest,@fields) = split /;/;
: ^^^^^^
: s/\$rest,//; # unless you want to discard the second field ;-)
I really *am* suffering from a caffeine deficiency this morning!
------------------------------
Date: Mon, 30 Nov 1998 18:02:45 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Encryption
Message-Id: <Pine.GSO.4.02A.9811301002280.26619-100000@user2.teleport.com>
On Mon, 30 Nov 1998 email@address.com wrote:
> Is there an easy way to encrypt a string and decrypt it back?
If there's a module which does what you want, it should be listed in
the module list on CPAN. If you don't find one to your liking, you're
welcome and encouraged to submit one! :-) Hope this helps!
http://www.perl.org/CPAN/
http://www.perl.com/CPAN/
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 30 Nov 1998 12:59:01 -0600
From: Tk Soh <r28629@email.sps.mot.com>
To: luoni@gol.com
Subject: Re: Folder Recurison
Message-Id: <3662EAF5.6310D2A7@email.sps.mot.com>
[posted to c.l.p.m and copy emailed]
Mario Luoni wrote:
>
> call the following subroutine with the top folder's SINGLE-QUOTED name as an
> argument. The complete file paths are included.
>
> sub scan {
> my $path = @_[0];
>
> if (!opendir(INDIR, "$path")) {
> push(@FILES,$path);
> return;
> }
>
> my @localfiles = readdir(INDIR);
> closedir(INDIR);
>
> foreach my $file (@localfiles) {
> next if $file=~/^\./;
> scan( "$path\\$file" );
> }
> return 0;
> }
>
> -Mario
>
> Richard Wilde wrote in message <3662C06B.74AD@kc3.co.uk>...
> >How can I get a list of all files into a @FILES array from a base
> >driectory INCLUDING all sub-directories.
> >
> >I have tried various methods and can only get the files from one
> >dirctory down from the sub directory. For example:
> >
> >|BaseDIR
> >|--->dir1 OK
> >|--->dir2 OK
> >|--->dir3 OK
> > |--->dir4 NO
> >
> >
> >Any help will be appreciated
for most purposes, the File::Find standard module more than adequate,
and more portable (you code woud likedly break when moved to Windose or
Mac). Unless you meant to make it part of your learning process, you
should always look up in CPAN first, to avoid reinventing the wheel.
-TK
------------------------------
Date: Mon, 30 Nov 1998 18:20:13 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: FTP transfers, was Re: Please help me solve three CGI problem: Make , Dir, Create file , and frameset
Message-Id: <Pine.HPP.3.95a.981130181628.4877I-100000@hpplus01.cern.ch>
On Mon, 30 Nov 1998, Tad McClellan wrote:
> If transferring between dissimilar systems, then you need
> ascii mode if you want the line endings adjusted to whatever
> is used by the receiving system.
That isn't all that "ascii" mode does, in general. There may be
character code translation (e.g between Mac and iso-8859-1, or between
EBCDIC and ASCII), depending on the platforms and the FTP
implementations involved.
cheers
------------------------------
Date: Mon, 30 Nov 1998 13:05:16 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Input from <TEXTAREA> via perl and DBI into MySQL database.
Message-Id: <comdog-ya02408000R3011981305160001@news.panix.com>
In article <3662BFB3.188FFFA1@internetxs.com>, adrian <adrian@internetxs.com> posted:
> On a webpage I have an area that people can input 'unlimited' length text
> using the <TEXTAREA> HTML tag. This is passed thru my perl script into
> a MySQL database using DBI and DBD:mysql. The receiving coloumn has been
> defined as TEXT.
> <p>Only this just doesn't work! If I "force" an entry of exactly what is
> input from the page by putting that in the INSERT statement the table does
> get updated?!
what error does DBI give you?
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 30 Nov 1998 18:01:02 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Input from <TEXTAREA> via perl and DBI into MySQL database.
Message-Id: <Pine.GSO.4.02A.9811301000230.26619-100000@user2.teleport.com>
On 30 Nov 1998, adrian wrote:
> On a webpage I have an area that people can input 'unlimited' length
> text using the <TEXTAREA> HTML tag. This is passed thru my perl script
> into a MySQL database using DBI and DBD:mysql. The receiving coloumn
> has been defined as TEXT.
>
> Only this just doesn't work!
That's because you're doing it wrong. I'd be more specific, but you didn't
give anything more to go on.
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.
http://www.perl.com/CPAN/
http://www.perl.org/CPAN/
http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
http://www.perl.org/CPAN/doc/manual/html/pod/
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 30 Nov 1998 18:54:23 GMT
From: weinerk@usa.net
Subject: re: LWP::UserAgent leaks memory?
Message-Id: <73upkn$lfa$1@nnrp1.dejanews.com>
LWP::UserAgent leaks memory?
checked with the following script
and it monotonically increases mem usage
use strict 'vars';
use LWP::UserAgent;
while (1) {
get_http();
}
sub get_http {
my ($req, $res);
my $ua = new LWP::UserAgent;
$ua->agent("Mozilla");
$req = new HTTP::Request GET => "http://site/";
$res = $ua->request($req);
}
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 30 Nov 1998 18:25:51 GMT
From: wyndo@cxo.com
Subject: Multiplayer Roleplaying Game, Web-Based, Written in Perl.
Message-Id: <73unup$jvu$1@nnrp1.dejanews.com>
First, I want to thank the people from comp.lang.perl.misc and
comp.lang.javascript for answering my few Perl & JavaScript questions over the
past few months.
Tomorrow (December 1st) we will be opening LUNATIX ONLINE: GLOBAL INSANITY
CRISIS for public play. It's still in Beta and is still undergoing some
development, but it's very playable and integrated chat works -- billions of
channels (no actions/emotes/whispering *yet* but that is to come). It's
written in PERL, plays through Netscape 4.0 or MSIE 4.0, and is a
multi-player role playing game (lite) set in an Insane Asylum. It doesn't
cost anything just to come check it out. :)
The URL to the game will be posted at http://www.prowler-pro.com/logic/
tomorrow (December 1st).
Also, I'm interested in linking to other web-based games, especially
multi-player ones... and ESPECIALLY those written in Perl. I've tried
net searching for some, but I can only find a few (which I'm going to link
to) -- LORD FTW, Earth 2025 -- and those seem to be done with Active Server
Pages, not Perl.
Thanks for reading,
Mike Snyder
Prowler Productions
http://www.prowler-pro.com/
http://www.prowler-pro.com/logic/
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 30 Nov 1998 14:03:07 -0500
From: llopis@zonker.ecs.umass.edu (Noel Llopis)
Subject: Re: Multiplayer Roleplaying Game, Web-Based, Written in Perl.
Message-Id: <MPG.10ccb5f985594d869896fb@news.oit.umass.edu>
In article <73unup$jvu$1@nnrp1.dejanews.com>, wyndo@cxo.com says...
> First, I want to thank the people from comp.lang.perl.misc and
> comp.lang.javascript for answering my few Perl & JavaScript questions over the
> past few months.
>
> Tomorrow (December 1st) we will be opening LUNATIX ONLINE: GLOBAL INSANITY
> CRISIS for public play. It's still in Beta and is still undergoing some
> development, but it's very playable and integrated chat works -- billions of
> channels (no actions/emotes/whispering *yet* but that is to come). It's
> written in PERL, plays through Netscape 4.0 or MSIE 4.0, and is a
> multi-player role playing game (lite) set in an Insane Asylum. It doesn't
> cost anything just to come check it out. :)
They "forgot" to tell us that we'll be paying for the honor of
using a Beta version and help them in the development process.
How nice of them.
--Noel
------------------------------
Date: Wed, 25 Nov 1998 22:49:05 -0800
From: "PCM" <pulsecode@mailandnews.dot.com>
Subject: Re: Perl CGI 500 Server Error on PWS
Message-Id: <73itn9$90m$1@news-01.meganews.com>
Ran just fine for me... I've set up a Win95/PWS and a WinNT/IIS system with
these hacks and it runs just fine. My instructions said something different
than yours:
>HKEY_LOCAL_MACHINE/.../W3Svc/Parameters/Script
Mine said:
HKEY_LOCAL_MACHINE/.../W3Svc/Parameters/Script Map/
-Patrick
Lonnie Johnson wrote in message <73i7u2$641@nnrp1.farm.idt.net>...
>I now get "500 Server Error"...
>I have verified the following in the registry...
------------------------------
Date: Mon, 30 Nov 1998 18:36:48 +0000
From: "Dr. Perry Xiao" <xiaop@sbu.ac.uk>
Subject: Perl CGI program
Message-Id: <3662E5C0.8B960A00@sbu.ac.uk>
Dear all,
I am try to write a CGI program using Perl to allow users to sign the
guest book in my www page,
the web page is in .public_html folder and CGI program guestbook.pl is
in .public_html/cgi-bin/
folder, both files have been change to "chmod 777", but each when I try
to run the program, I
got a error message of
***********************************************************************
Method Not Allowed
The requested method POST is not allowed for the URL
/~xiaop/cgi-bin/guestbook.pl.
***********************************************************************
Does anybody know what the problem is?????????
Thanks!!
Perry
------------------------------
Date: Mon, 30 Nov 1998 19:17:51 -0000
From: "Clinton Gormley" <cgormley@netcomuk.co.uk>
Subject: Re: Perl CGI program
Message-Id: <73ur0i$kol$1@taliesin.netcom.net.uk>
Your directory has been configured to not allow POSTs (ie submitting forms
with method="POST") You could try specifying <form method="GET"> or
reconfigure your web server.
Either way, it is a web server issue rather than Perl.
Hope it helps
Clint
Dr. Perry Xiao wrote in message <3662E5C0.8B960A00@sbu.ac.uk>...
>Dear all,
>
>I am try to write a CGI program using Perl to allow users to sign the
>guest book in my www page,
>the web page is in .public_html folder and CGI program guestbook.pl is
>in .public_html/cgi-bin/
>folder, both files have been change to "chmod 777", but each when I try
>to run the program, I
>got a error message of
>
>***********************************************************************
>Method Not Allowed
>
>The requested method POST is not allowed for the URL
>/~xiaop/cgi-bin/guestbook.pl.
>***********************************************************************
>
>Does anybody know what the problem is?????????
>
>Thanks!!
>
>Perry
>
------------------------------
Date: Mon, 30 Nov 1998 19:19:03 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Perl CGI program
Message-Id: <Pine.GSO.4.02A.9811301118390.19172-100000@user2.teleport.com>
On Mon, 30 Nov 1998, Dr. Perry Xiao wrote:
> Method Not Allowed
Looks like a server error message.
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.
http://www.perl.com/CPAN/
http://www.perl.org/CPAN/
http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
http://www.perl.org/CPAN/doc/manual/html/pod/
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 30 Nov 1998 18:49:03 GMT
From: dturley@pobox.com
Subject: Re: perl Tk
Message-Id: <73upao$l2n$1@nnrp1.dejanews.com>
In article <73uk7i$gl8$1@nnrp1.dejanews.com>,
dturley@pobox.com (that's me) wrote:
> $w_top = MainWindow->new('Tetris - Perl/Tk');
>
> The script dies at this line, with the error:
> Odd number of argsMainWindow->new(Tetris - Perl/Tk) at tetris.pl line 481
I should have checked the online errata -->
the line should be
$w_top = MainWindow->new(-title => 'Tetris - Perl/Tk');
--
David Turley
dturley@pobox.com
http://www.binary.net/dturley/
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 30 Nov 1998 19:44:36 GMT
From: "watsiyem" <watsiyem@vt.edu>
Subject: Perl to awk?
Message-Id: <01be1c99$dc79dae0$b36452c6@sstec.campus.vt.edu>
Hello!
I am very new to Perl programming, so excuse me if this topic has been
covered before.
I am aware of a program that will convert from awk to Perl, but is there
one available to do the reverse?
Thanks,
Matt
--
watsiyem
NOSPAMwatsiyem@vt.edu
------------------------------
Date: Mon, 30 Nov 1998 19:58:48 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Perl to awk?
Message-Id: <Pine.GSO.4.02A.9811301155461.19172-100000@user2.teleport.com>
On 30 Nov 1998, watsiyem wrote:
> I am aware of a program that will convert from awk to Perl, but is there
> one available to do the reverse?
perl's set of capabilities is a superset of that of awk. No, there's no
such program, and I'll bet you a box of donuts that there never will be.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 30 Nov 1998 13:26:53 -0500
From: "Yao, Hsin (EXCHANGE:MTL:1T83)" <hsinyao@americasm01.nt.com>
Subject: Perl5.005 in HP-UNIX?
Message-Id: <3662E36D.B267CD99@americasm01.nt.com>
Hi:
Has anyone succesfully installed PERL5.005_02 with thread in a HP-UX
ver 10? I am having a lot of difficulty doing so. Suggestions for any
useful pointers are appreciated.
- Hsin Yun -
------------------------------
Date: Mon, 30 Nov 1998 18:18:08 GMT
From: theorb@my-dejanews.com
Subject: Reference to eval'd code
Message-Id: <73unge$jg4$1@nnrp1.dejanews.com>
I'm having a little problem -- I have an arbitrary piece of perl in a scalar
($fdat{'expr'}, to be exact, though I'm stuffing it into $expr for ease), and
I want to eval it, and display the result in a nice lil' peice of HTML.
You'd think this would be easy, but it isn't.
Code like $val = \(eval $expr); gives ref($val) always returning 'HASH'.
Similarly, $val = \eval $expr; always gives a ref to a scalar. Unfortunaly,
I don't want that casting behivor; I want the native return of $expr...
Hints? (Yes, I do need a reference; I want to check the type, dumping it
differently depending on it's type.) (Odd, I just double-checked. The
values are different from \eval $expr and \eval ($expr), etc.
The only way I've found to solve this is to eval ('\\' . $expr); but that
seems rather silly and forceful (though I think precidance will always make
it work.
Thank you,
-=- James Mastros
BTW -- perl 5.004_4, under HTML::Embperl 1.1
--
I'm really theorbtwo at yahoo.com.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 30 Nov 1998 19:49:07 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Reference to eval'd code
Message-Id: <Pine.GSO.4.02A.9811301143440.19172-100000@user2.teleport.com>
On Mon, 30 Nov 1998 theorb@my-dejanews.com wrote:
> I have an arbitrary piece of perl in a scalar
> I want to eval it,
Well, if you must. But eval of a string is generally better avoided.
> Code like $val = \(eval $expr); gives ref($val) always returning 'HASH'.
> Similarly, $val = \eval $expr; always gives a ref to a scalar.
It looks as if you want to get a reference to something. To what? And do
those two statements really give different values?
> I want the native return of $expr...
Do you mean that you want a reference to the data returned by that code?
In scalar or list context?
my $ref;
{
my $value = eval $expr;
die $@ if $@;
$ref = \$value; # one way to do it
}
my $ref = [ eval $expr ]; # one way to do something else
die $@ if $@;
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 30 Nov 1998 18:09:25 GMT
From: gward@thrak.cnri.reston.va.us (Greg Ward)
Subject: Re: single quote problems
Message-Id: <73un0l$nn3$1@news0-alterdial.uu.net>
On Mon, 30 Nov 1998, Gareth Ennis <gary.ennis@strath.ac.uk> wrote:
>Im trying to substitute text in a file from the Unix command line using:
>
>perl -pi -e 's/old string/new string/g' filename
>
>It works fine until i try and add a single quote (') in my new string :
>
>perl -pi -e 's/old string/hello 'people' howdy/g' filename
>
>What it prints is : hello people howdy
>but what i want is: hello 'people' howdy
Well, actually, you're not having a Perl problem: you're having a shell
problem. In fact, Perl's quoting rules are the way the are (powerful,
flexible, yet predictable) largely because of the god-awful mess that
most shells call "quoting rules".
What's happening is that your first ' opens a string, and the second one
closes it. Then you have "people", and then another quoted string.
That is, you're Perl program consists of three shell strings:
>s/old string/hello <
>people<
> howdy/g<
which the shell concatenates into a single "word" because they're
adjacent.
Here's a grotesque hack that builds on your concatenate-adjacent-shell-
strings dependency:
perl -pi -e 's/old string/hello '\'people\' howdy/g' filename
However, because you're depending on a shell feature here, you generally
can't depend on it.
>Please note i cannot use the double quotes(") since its for a piece of
>code which does not accept them.
Umm, you didn't specify *where* you can't use double quotes. I assume
in the output -- that is, you must have 'people' not "people" in the
output file. However, if you don't mind having double quotes at the
shell level, you can do this:
perl -pi -e "s/old string/hello 'people' howdy/g" filename
No problem since you don't have any Perl scalar variables ($foo, $bar)
in your code.
In general, when you run into shell quoting problems, it's best to ditch
the shell and do everything in Perl. The more code you write to get
around the shell's oddities, the worse your quoting problems will become.
Greg
--
Greg Ward - software developer gward@cnri.reston.va.us
Corporation for National Research Initiatives
1895 Preston White Drive voice: +1-703-620-8990 x287
Reston, Virginia, USA 20191-5434 fax: +1-703-620-0913
------------------------------
Date: 30 Nov 1998 18:32:03 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: single quote problems
Message-Id: <73uob3$fbh@fcnews.fc.hp.com>
Gareth Ennis (gary.ennis@strath.ac.uk) wrote:
: Im trying to substitute text in a file from the Unix command line using:
: perl -pi -e 's/old string/new string/g' filename
: It works fine until i try and add a single quote (') in my new string :
: perl -pi -e 's/old string/hello 'people' howdy/g' filename
: What it prints is : hello people howdy
: but what i want is: hello 'people' howdy
This is actually due to the shell you are using parsing your single-quotes
out like so:
'single-quoted-string'non-quotedstring'more single-quoted-string'. You
probably want to read the "Quoting" section of your unix shell
manpage. Most shells will pass through single quotes inside of double
quotes, so you could try:
perl -pi -e "s/old string/hello 'people' howdy/g" filename
Unfortunately, shell variables will be interpolated inside double
quotes, which is not what you want (but is fine for this case, since
you're not using any $var constructs inside the double quotes). If you
really need to use single quotes, you can use the messy:
perl -pi -e 's/old string/hello '\''people'\'' howdy/g' filename
The '\'' sequence means: end the current single-quoted string, insert
a literal single-quote via backslash-quoting, and then start another
single-quoted string.
Good luck!
Andrew
------------------------------
Date: Mon, 30 Nov 1998 11:09:55 -0800
From: Neelam Saini <neelam@healtheon.com>
Subject: Use of uninitialized value with $ARGV[0] ??
Message-Id: <3662ED83.3DD0B6B3@healtheon.com>
Hi,
I am getting the following error when rujnning my program with -w
while ($ARGV[0] = ~ /^-/)
Use of uninitialized value at newdump line 16 (#1)
(W) An undefined value was used as if it were already defined. It
was
interpreted as a "" or a 0, but maybe it was a mistake. To suppress
this
warning assign an initial value to your variables.
When I check the value of $ARGV[0] , it does contain some value. What's
going on ?
NS
------------------------------
Date: Mon, 30 Nov 1998 19:42:04 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Use of uninitialized value with $ARGV[0] ??
Message-Id: <Pine.GSO.4.02A.9811301140470.19172-100000@user2.teleport.com>
On Mon, 30 Nov 1998, Neelam Saini wrote:
> while ($ARGV[0] = ~ /^-/)
I think you wanted the binding operator in there, rather than an
assignment operator followed by a bit-complement. Try removing the space
between the equals sign and the tilde. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 30 Nov 1998 18:57:19 GMT
From: rick.schwein@phillynews.com
Subject: Re: variables in substitutions
Message-Id: <73upq4$ljh$1@nnrp1.dejanews.com>
In article <7veu37.j7v.ln@flash.net>,
tadmc@flash.net (Tad McClellan) wrote:
>
> But now you have the problem of determining when to do
>
> s/$search/$replace/gi; # for /aaa/qqq/
>
> and
>
> s/$search/$replace/giee; # for /(bbbb)(.*)(ee)/$3.$2.$1/
>
> ...
Ahh.. I'd overlooked the fact that additional levels of execution could be
specified on the right side of the expression. Thanks much.
My control file now reads:
/(term_1)(.*)(term_3)/$3.$2.$1/
And the script reads:
s/$search/$replace/giee ; # and it works perfectly!
I *knew* there would be at least one way to do it.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 30 Nov 1998 18:14:13 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: When does CLOSE not FLUSH?
Message-Id: <Pine.GSO.4.02A.9811301004520.26619-100000@user2.teleport.com>
On Mon, 30 Nov 1998, Clinton Gormley wrote:
> Subject: When does CLOSE not FLUSH?
When your system is broken. :-)
> The process of the script is :
> (1) open (>>FH)
> (2) flock (FH,LOCK_EX)
> (3) print FH encrypted "foobar"-->takes about 4 seconds.
> (4) close (FH);
Four seconds? Is that lag due to the encryption, or is your system really
hosed?
> more than one script can run at the same time.
>
> My understanding was that close would (1) flush the file buffer and
> (2)unlock the file.
Yes.
> in practice, I found that if 10 scripts were called, only 1 or 2 lines
> of (encrypted "foobar") were being written to the file. The LOCK_EX
> was working however.
Could this be happening over NFS or something similar? Locking may not be
reliable over systems like NFS. If that's not the problem, and if you're
using a relatively recent perl, you've found a serious bug. Of course,
there's no telling yet whether that bug is in your code, in perl, in your
OS, or elsewhere.
To be sure, you should make a small, stand-alone example, checking the
return values from system calls (including lock and close) to see whether
they're trying to tell you anything. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 30 Nov 1998 19:09:17 -0000
From: "Clinton Gormley" <cgormley@netcomuk.co.uk>
Subject: Re: When does CLOSE not FLUSH?
Message-Id: <73uqga$kf2$1@taliesin.netcom.net.uk>
Tom Phoenix wrote in message ...
>On Mon, 30 Nov 1998, Clinton Gormley wrote:
>
>> Subject: When does CLOSE not FLUSH?
>
>When your system is broken. :-)
The same thing happens on RedHat linux 5.1
>> (3) print FH encrypted "foobar"-->takes about 4 seconds.
>
>Four seconds? Is that lag due to the encryption, or is your system really
>hosed?
That's encryption doing its bit - approx 650 bytes encrypted with RSA.
>
>> My understanding was that close would (1) flush the file buffer and
>> (2)unlock the file.
>
>Yes.
>
>> in practice, I found that if 10 scripts were called, only 1 or 2 lines
>> of (encrypted "foobar") were being written to the file. The LOCK_EX
>> was working however.
>
>Could this be happening over NFS or something similar? Locking may not be
>reliable over systems like NFS. If that's not the problem, and if you're
>using a relatively recent perl, you've found a serious bug. Of course,
>there's no telling yet whether that bug is in your code, in perl, in your
>OS, or elsewhere.
This does not use NFS - local directory.
>
>To be sure, you should make a small, stand-alone example, checking the
>return values from system calls (including lock and close) to see whether
>they're trying to tell you anything. Good luck!
Following your advice, I found that I got an "Illegal seek" when i closed
the file. Turns out that I was closing (fh) having opened (FH).
When i changed this, it sorted out my problem of flushing the buffer.
However, surely any open file handles are closed when the script exits (and
thus presumably flushed?) I wasn't unlocking the file before exiting the
script. When i did unlock the file first (with the erroneous close in
place), this also served to flush the buffer.
So does a close that is initiated by the script exiting not flush the
buffer?
thanks for your time
Clint
>
>--
>Tom Phoenix Perl Training and Hacking Esperanto
>Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
>
------------------------------
Date: Mon, 30 Nov 1998 19:38:59 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: When does CLOSE not FLUSH?
Message-Id: <Pine.GSO.4.02A.9811301132230.19172-100000@user2.teleport.com>
On Mon, 30 Nov 1998, Clinton Gormley wrote:
> >> (3) print FH encrypted "foobar"-->takes about 4 seconds.
> >
> >Four seconds? Is that lag due to the encryption, or is your system really
> >hosed?
>
> That's encryption doing its bit - approx 650 bytes encrypted with RSA.
Hmmm... Could you be calling an external program with system() to do this?
(Yes, that would be the wrong way to do it! :-)
> Following your advice, I found that I got an "Illegal seek" when i closed
> the file. Turns out that I was closing (fh) having opened (FH).
>
> When i changed this, it sorted out my problem of flushing the buffer.
>
> However, surely any open file handles are closed when the script exits
> (and thus presumably flushed?)
Yes, unless something terribly wrong happens. (They're still closed, in
that case, but they may not be flushed.)
> When i did unlock the file first (with the
> erroneous close in place), this also served to flush the buffer.
That's perl, trying to save you from your mistakes. :-) But it's a waste
of an opcode, if you're only going to close the file anyway.
But if you've got that small, self-contained example of data not being
written properly when a file is auto-closed by Perl, please post it here.
Thanks!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 30 Nov 1998 15:02:37 -0500
From: Tripp Lilley <tripp.lilley@perspex.com>
To: "Andrey L. Abramov" <abramoa@leland.stanford.edu>
Subject: Re: Win16 DLL access (on NT) Help!!!
Message-Id: <3662F9DD.73DBBDFE@perspex.com>
I refer the honorable gentleman to my previous posting on the subject,
archived at dejanews.com. A search on "perl 16-bit dll" will present it.
It points to several relevant sources of information. Now, for a question
of my own -- could someone please suggest which FAQ would be the most
appropriate to which to submit this answer?
Thanks...
- t.
------------------------------
Date: Mon, 30 Nov 1998 09:59:42 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Y2K and Programmer Denial
Message-Id: <MPG.10cc7cea5bf3189798989a@nntp.hpl.hp.com>
In article <73ujjq$27u$1@Venus.mcs.net> on 30 Nov 1998 11:11:22 -0600,
Leslie Mikesell <les@MCS.COM> says...
> Has anyone actually done this to look for '19' used in string context
> in association with a value obtained from a *time() function with
> anywhere near the intensity of 'taint' checking?
That might catch the 'Year 19100' bug, but not the 'Year 100' bug
(use of $year as a two-digit value without '% 100').
We can expect to see many of those. For example, in parsing
'Last-Modified' responses from a web server that reports dates as,
e.g., 30-11-98, defensive coding is required to protect against
that server soon responding '01-01-100'.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 30 Nov 1998 19:30:37 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Y2K and Programmer Denial
Message-Id: <73urot$g1a$1@marina.cinenet.net>
finsol@ts.co.nz wrote:
[snip]
: Many of you following the debate may be interested in reading further on
: the subject discussed. My first article was on 'booby trap code', a
: problem that affects
It is very difficult to take anything else you say seriously when your
list of 'programming languages' --
: programming languages such as Perl, MacPerl, C, C++, Java,
: Javascript, CGI, MVS and CICS.
-- consists of two variants of the same language, two languages that share
the same time-handling underpinnings, two other languages, and then -- the
kicker -- an interface specification and two operating systems.
I stopped reading at this point.
--
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "The hills were burning, and the wind was raging; and there
was no more room in the Garden of Allah."
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 4325
**************************************