[12589] in Perl-Users-Digest
Perl-Users Digest, Issue: 6189 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 1 09:07:24 1999
Date: Thu, 1 Jul 99 06:00:22 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 1 Jul 1999 Volume: 8 Number: 6189
Today's topics:
"Pushing" keys from Perl program. <xyf@inetnebr.com>
Attn ex-Lispheads: Acl5 + PerlCOM <kucerar@hhmi.org>
check difference of two files <riccardo.gubser@ubs.com>
Filename from <STDIN> <hove@ido.phys.ntnu.no>
Re: How do I join CGI stuff to existing web pages? (sim <pkg@studbox.uni-stuttgart.de>
Re: How do I join CGI stuff to existing web pages? (sim <jukka.juslin@cern.ch>
Re: How to store hashes <tchrist@mox.perl.com>
Re: In Mountain View did Larry Wall <e.h.bogart@larc.nasa.gov>
Re: interger overflow like in C <garethr@cre.canon.co.uk>
Re: make my day fix an array :-) <revjack@radix.net>
Re: MakeMaker bug ? (Earl Hood)
module to connect to a Microsfot Access mdb database <webbat@globalnet.co.uk>
Re: Perl Problem with Netscape, but not lynx... <martin@adoma.se>
Re: Perl redirection script question (David Efflandt)
Re: Perl/CGI seems an inconsistant language... (elephant)
Re: Perl/CGI seems an inconsistant language... <haakon.alstadheim@sds.no>
Re: Premature end of script headers: <td90537@hotmail.com>
Re: Premature end of script headers: <td90537@hotmail.com>
Re: Problem with cgi script and reading data... <pkg@studbox.uni-stuttgart.de>
Re: regex to match RCS string <garethr@cre.canon.co.uk>
Saving both exit status and output from a command (TM Lehto)
Re: sorting info from Hashes <pkg@studbox.uni-stuttgart.de>
Re: use posix <gellyfish@gellyfish.com>
Re: Using sockets (Lars Gregersen)
Why are System V IPC calls deprecated? <robin@netgates.co.uk>
Write <option> to a file (Arnaud Limbourg)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 01 Jul 1999 07:31:51 -0500
From: ktb <xyf@inetnebr.com>
Subject: "Pushing" keys from Perl program.
Message-Id: <377B5FB7.15CC2A3E@inetnebr.com>
I would like to create a program that when run would type for me. I
have a problem getting the 'num lock' key to work under linux in X.
I've tried several fixes to no avail. I thought there must be someway
to tell the computer to "turn" this key on. Is there a way to "push"
keyboard keys with Perl?
Thanks,
kent
------------------------------
Date: Thu, 1 Jul 1999 08:47:16 -0400
From: "Kucera, Rich" <kucerar@hhmi.org>
Subject: Attn ex-Lispheads: Acl5 + PerlCOM
Message-Id: <80C621FFC2DFD2119FFF00805FA7C54F0304BE08@exchange1.hhmi.org>
Another Lisp Incarnation: the LispPerl powerstation...Franz ACL Lite +
ActiveState PDK PerlCOM trial
version. Neither product includes an example of how to have the perl
engine available within the Lisp listener,
[ADVOCACY ON]
obviously the most powerful combination of language resources there
would be, well here it is solving
a classic problem...a short message posted to comp.lang.lisp followed by
complete source for
perl.cl (which is the hacked sample 01 from ole subdirectory in ACL5
distribution). Another possible
application is to use the highly interesting CL-HTTP and hang ex-cgi
Perl modules off it running on
In or Out of Proc server, how bad can performance be, just add more
processors and memory for pete's sake
and don't waste another 8 years hacking C-based languages...this is not
to mention all the possibilities
that come up once you load LWP and DBI for web mining and reconstituting
legacy proprietary 2-tier into
N-tier component assets within CLOS...all in your own copious spare time
of course since there is
no mandate for anything but Java and VBscript :-(...drool, look folks,
it's your brains, why waste
any more time sniffing Java to the benefit of shareholders everywhere?
[ADVOCACY OFF]
-----------------Regards, R, spoiled better-is-better ex-Symbolics
hack
Use PerlCOM or some other bus to Perl. Here's your example using
PerlCOM.
Why write a state machine and all that other stuff? Yeah portable, but
the bus...
First, the code:
(let ((perltool (ole:ask-for-autotool
"PerlCOM.Script"
ole:CLSCTX_INPROC_SERVER)))
(ole:auto-method perltool
"EvalScript"
"$greeting='(\"'.join('\" \"', split(/ /, qq[Now is the time for
PerlCOM])).'\")';")
(format t "... and then PerlCOM said: ~A"
(ole:auto-getf perltool :greeting))
Here's the listener session:
>
; Loading D:\acl50lite\ole\samples\activePerl\perl.cl
> (test)
Starting OLE PerlCOM test.
... and then PerlCOM said: ("Now" "is" "the" "time" "for" "PerlCOM")
The PerlCOM test is complete.
>
Now, Lisp is so great, it ought to be able to coax that property
into an actual list, right?
-----Original Message-----
From: ibum@news2.stic.net (IBMackey) [mailto:ibum@news2.stic.net]
Posted At: Tuesday, June 29, 1999 4:22 PM
Posted To: lisp
Conversation: Convert string of words to list of strings
Subject: Convert string of words to list of strings
I've only stratched the surface of lisp, but I'm trying. I want to
convert a string to a list of strings. For example,
"Now is the time" ==> ("Now" "is" "the" "time")
The best I've been able to do with the functions read-from-string and
concatenate is this
"Now is the time" ==> (Now is the time)
With the list of strings, I can do an interated process to call
another program. I don't know what to do with a list of symbols.
Any help is appreciated.
I.B.
PERL.CL SOURCE:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Sample program illustrating the use of an autotool object
;; to drive an inproc automation server.
;;
;; Compile and Load this file, then evaluate (test)
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(in-package :user)
;; Compiling OLE source needs the OLE Development tools.
(eval-when (compile eval)
(require :ole-dev))
;; Running OLE source requires the OLE Runtime package.
(eval-when (load eval)
(require :ole))
;; We need to know the classid of the object we intend to create
;; We'll put it in the preferred form by using unique-guid.
(defparameter perl-classid
(ole:unique-guid "{B5863EF3-7B28-11D1-8106-0000B4234391}"))
;; PerlCOM.Script {B5863EF3-7B28-11D1-8106-0000B4234391}
;; PerlCOM type library {B5863EF1-7B28-11D1-8106-0000B4234391}
(defun test ()
;; muffle gc reports
(setf (sys:gsgc-switch :print) nil)
;; first check the registry to be sure PerlCOM is out there
(ole:with-open-registry-key (perl-reg ole:rkey-classes-root
`("CLSID" ,(ole:guid-name
perl-classid))
:error-return nil)
(when (null perl-reg)
(format t "Sorry, no PerlCOM on this system~2%")
(return-from test nil)))
;; We need a fanfare.
(format t "~2%Starting OLE PerlCOM test.~2%")
;; just in case ole hasn't yet been started ...
(ole:start-ole)
;; we allocate a single, so we don't bother with a factory
;; other autotool arg: perl-classid
(let ((perltool (ole:ask-for-autotool
"PerlCOM.Script"
ole:CLSCTX_INPROC_SERVER)))
;; now that we have one, we'll poke at it a bit
;; (let ((hash (ole:auto-method perltool :CreateObject))))
(ole:auto-method perltool "EvalScript" "$greeting='(\"'.join('\"
\"', split(/ /, qq[Now is the time for PerlCOM])).'\")';")
;; also can use setf on the auto-getf form to change a property
value.
;; (setf (ole:auto-getf perltool :day) 7)
(format t "... and then PerlCOM said: ~A"
(ole:auto-getf perltool :greeting))
;; now we're done, we'll let the PerlCOM go away
(ole:release perltool)
;; A closing note.
(format t "~2%The PerlCOM test is complete.~2%")
(values)))
;; When it's time to leave, we stop ole and exit
(defun done ()
(ole:stop-ole)
(exit 0))
------------------------------
Date: Thu, 01 Jul 1999 13:59:54 +0200
From: Riccardo Gubser <riccardo.gubser@ubs.com>
Subject: check difference of two files
Message-Id: <377B583A.938CDD0D@ubs.com>
I have two file's who i have to check daily. I just wanna open a Handle
if there is a difference between them. Doe's anyone knows a reason how i
can check them without a Handle?
Greetings
Ricc
------------------------------
Date: 01 Jul 1999 14:18:48 +0200
From: Joakim Hove <hove@ido.phys.ntnu.no>
Subject: Filename from <STDIN>
Message-Id: <k0n3dz8k1g7.fsf@ido.phys.ntnu.no>
Hello,
I have written a little script to remove comments from LaTeX source
files. The script reads :
#!/store/bin/perl -w
while (<>) {
chomp;
if ($_ eq "") { print "\n"; next; }
s/%.+//;
if ($_) { print ($_,"\n"); }
if (m/\\end{document}/) { last; }
}
Now my plan was to call this script as :
bash% latex_uncomment.pl < commented_file.tex > un_commented_file.tex
i.e. the original file "commented_file.tex" is sent as <STDIN> to the
script, and the version stripped of comments is sent out to
<STDOUT>. Now, this works fine, however accidentally I found that
calling the script as :
bash% latex_uncomment.pl commented_file.tex > un_commented_file.tex
actually works fine as well. For this to work (as I understand it !)
Perl must interpret $ARGV[0] as the file name to be related to the <>
filehandle, and silently opening this file. Have I understood
correctly?
Everything works as I intended it to, so I'm not excactly asking for
help in any way, just out of curiosity, hope that is OK :-)
Joakim
--
=== Joakim Hove www.phys.ntnu.no/~hove/ ======================
# Institutt for fysikk (735) 93637 / 352 GF | Skxyensgate 10D #
# N - 7034 Trondheim hove@phys.ntnu.no | N - 7030 Trondheim #
=====================================================================
------------------------------
Date: Thu, 01 Jul 1999 13:47:48 +0200
From: Pete Gilbert <pkg@studbox.uni-stuttgart.de>
Subject: Re: How do I join CGI stuff to existing web pages? (simple)
Message-Id: <377B5564.82F85764@studbox.uni-stuttgart.de>
I have a subroutine which takes a filename and a a hash reference. uses
the hash keys as regular expressions, and substitutes any matches found
in the file with the value for that key.
I make a template html, with comments where i want data to go, then in
the CGI get all the data i will need, then call the function, with html
comments as keys and the data (with html formatting) as values
sub send_html
{
my($filename,$ref_varhash) = @_;
open(HTML, "$filename") or croak "can't open $filename: $!";
my(@html) = <HTML>; #hmmm perhaps looling like a tag is bad
close(HTML);
my($html) = join("",@html);
my($var);
foreach $var (keys %$ref_varhash)
{
$html =~ s/$var/$$ref_varhash{$var}/g;
}
print $html or return 0;
return 1;
}# end send_html
sample use:
$name = 'pete' #or get some db data here
$ulterior_motive = 'subversion of automobile paradigm' #or more db data
$filename = "./html_template.html"
send_html( $filename, {'<!-- name -->' => $name, '<!-- motive -->' =>
$ulterior_motive} );
this could no doubt be optimized and so on, its just what i use to get
the job done
hope this helps
GJohn wrote:
>
> We want to do our first web site which interacts with a db. I have been
> learning Perl & DBD:DBI on the weekends, so I can write CGI scripts
> which accept data from user & display info from the database along with
> a few HTML tags to display headers etc. But it doesn't look pretty.
> Others in our company have skills in Dreamweaver to create pretty web
> sites, but without the db interaction. The boss says these designers
> should learn PHP3, but I want to be part of the new project & therefore
> I am pushing to use my existing Perl skills (I don't know PHP3). What I
> need to do is get the pretty pages output from Dreamweaver & then add
> my CGI stuff.
--
Pete Gilbert *** email: pkg@studbox.uni-stuttgart.de
------------------------------
Date: Thu, 01 Jul 1999 13:15:13 +0200
From: Jukka Juslin <jukka.juslin@cern.ch>
Subject: Re: How do I join CGI stuff to existing web pages? (simple)
Message-Id: <377B4DC1.1C9F9CFB@cern.ch>
GJohn wrote:
>
> We want to do our first web site which interacts with a db. I have been
> learning Perl & DBD:DBI on the weekends, so I can write CGI scripts
> which accept data from user & display info from the database along with
> a few HTML tags to display headers etc. But it doesn't look pretty.
> Others in our company have skills in Dreamweaver to create pretty web
> sites, but without the db interaction. The boss says these designers
> should learn PHP3, but I want to be part of the new project & therefore
> I am pushing to use my existing Perl skills (I don't know PHP3). What I
> need to do is get the pretty pages output from Dreamweaver & then add
> my CGI stuff.
What about usin server side includes (SSI)?
++Jukka
------------------------------
Date: 1 Jul 1999 06:26:08 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to store hashes
Message-Id: <377b5e60@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc, bart.lateur@skynet.be (Bart Lateur) writes:
:DB files tend to grow terribly big. If you just want to store some
:temporary session data, tab-delimited text files are as small as it can
:get.
"quote-delimited-stuff"
"hyphen-separated-stuff"
"bang-terminated-stuff"!
If you're not getting dij` lu by now, my NNTP server hates me.
--tom
--
"Perl is to sed as C is to assembly language." -me
------------------------------
Date: Thu, 01 Jul 1999 08:04:04 -0400
From: Ed Bogart <e.h.bogart@larc.nasa.gov>
Subject: Re: In Mountain View did Larry Wall
Message-Id: <377B5933.2E656F7@larc.nasa.gov>
Peter Scott wrote:
>
> I had a brilliantly witty response to this epic posting but there was
> a knock at the door and when I returned, I had forgotten what I was
> going to say...
>
> --
>
> Disclaimer: These comments are the personal opinions of the author, and
> have not been adopted, authorized, ratified, or approved by JPL.
If there ever was proof that Perl and Perlpeople were superior, this
thread is it! This will make me smile for the rest of the day. Thank you
all.
Ed
------------------------------
Date: Thu, 1 Jul 1999 11:41:30 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
To: Andrey Kolotev <ank@elcat.kg>
Subject: Re: interger overflow like in C
Message-Id: <si1zeswqad.fsf@cre.canon.co.uk>
Andrey Kolotev <ank@elcat.kg> wrote:
> Can you explain, how can I get the same behavior of interger
> arithmetics in perl as I have in "C"
See the `perlop' manpage:
Integer Arithmetic
By default Perl assumes that it must do most of its
arithmetic in floating point. But by saying
use integer;
you may tell the compiler that it's okay to use integer
operations from here to the end of the enclosing BLOCK. An
inner BLOCK may countermand this by saying
no integer;
which lasts until the end of that BLOCK.
--
Gareth Rees
------------------------------
Date: 1 Jul 1999 12:20:31 GMT
From: revjack <revjack@radix.net>
Subject: Re: make my day fix an array :-)
Message-Id: <7lfmef$i41$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight
Thomas Weholt explains it all:
:Can`t you answer one posting without being an a**h**e?
Personally, I'm glad that Uri serves as such an effective archive.
------------------------------
Date: 30 Jun 1999 22:25:18 GMT
From: ehood@medusa.acs.uci.edu (Earl Hood)
Subject: Re: MakeMaker bug ?
Message-Id: <7le5ge$dpu@news.service.uci.edu>
In article <377A918D.E57755CE@virgin.net>,
Simon Griffiths <s.griffiths@virgin.net> wrote:
>However, I'm trying to upgrade to Perl/Tk 8.000.14 and getting problems.
>"perl Makefile.PL" seems to run OK, but "make" always fails with a make
>error :
> make : line too long after substituting variables
Have you tried gmake?
>I originally posted this under as a Tk problem, but now I think it
>might really be a MakeMaker bug.
MakeMaker is just doing what it is told. The problem is with make.
If something like gmake does not work, then Tk module installation
needs to be modified to avoid the limitations of make.
--ewh
--
Earl Hood | University of California: Irvine
ehood@medusa.acs.uci.edu | Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME
------------------------------
Date: Thu, 1 Jul 1999 12:48:54 +0100
From: "david" <webbat@globalnet.co.uk>
Subject: module to connect to a Microsfot Access mdb database
Message-Id: <7lfkpn$ru5$1@gxsn.com>
as a newbie can someone please direct me to a perl module so that i can
connect my web pages to a MS Access mdb database table...
anyhelp would be much app.
thanx in advance
David
------------------------------
Date: Thu, 01 Jul 1999 12:48:47 +0100
From: Martin Quensel <martin@adoma.se>
Subject: Re: Perl Problem with Netscape, but not lynx...
Message-Id: <377B559F.5097804@adoma.se>
illiath@my-deja.com wrote:
>
> I'm just starting to learn perl/cgi programming, and I've got a small
> problem here.
>
> I have written a small script (it doesn't do all it's supposed to do but
> that's not important really), and it displays fine (when using lynx),
> but netscape refuses to display it at all.
>
> I'm not sure whether this is just a problem with netscape, or whether my
> code is faulty, and unfortunately as I am posting this from deja I am
> unable to attach the script... so... umm.. yeah...
>
> Everything else seems to be saying it is fine, If I ask netscape to
> display the source of the page (the output from the script), it displays
> the source code properly.
>
If it displays the code when you go to view source..then you should try
to learn HTML!
For example...somethings like tables could be a problem if you never
finish them properly.
If you for example have a whole page in a big table, and dont finish
that table with </table> then..in some browsers you wont se a thing.
run your script!
look at the source, from your browser. if you see source there...your
script works, but you cant code HTML properly.
Best regards Martin Quensel
------------------------------
Date: 1 Jul 1999 11:23:02 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Perl redirection script question
Message-Id: <slrn7nmjo8.l7.efflandt@efflandt.xnet.com>
You probably want to refer to your webserver docs and a suitable webserver
newsgroup, since that can usually be done with server directives (often
from an .htaccess file in your own webspace).
Otherwise, if you can run something like an index.cgi (instead of
index.html) as a directory default, see if $ENV{HTTP_HOST} has the desired
hostname and redirect based on that.
#!/usr/local/bin/perl
$ENV{HTTP_HOST} =~ /^www.([^\.]+)\./ && $myhost = $1;
if ($myhost eq /^future-wave$/ || !$myhost) {
print "Location: /home.html\n\n";
} else {
print "Location: /$myhost.html\n\n";
}
Or if you don't want them to have access to your top level directory,
something like: "Location: http://$ENV{HTTP_HOST}/$myhost/\n\n"
On 28 Jun 1999 10:49:51 PDT, Alex Augot <alexaugot@future-wave.com> wrote:
>I'm currently trying to solve a problem that I have with a few clients and
>their domain names. I have an account on a server, with a nice 700 meg
>limit, but my provider won't let me divide up accounts so they can be used
>with domain names. They only let me "park" domain names, which means every
>domain name I park redirects back to my main page. (ie. Everyone who types
>in www.parrealtygroup.com will get my main page at www.future-wave.com )
>What I am wondering, is if there are any scripts out there that can tell
>what name request is being made, and then redirect to a sub dir. I know you
>can emulate 3rd lv domains somewhat simply, so is this realistic?
>
>If there are no scripts out there like that, how would I go about writing
>one. I'm pretty much a beginner at perl, but I think I could get it to work
>if I tried.
>
>-Alex Augot
>
>
>
--
David Efflandt efflandt@xnet.com http://www.xnet.com/~efflandt/
http://www.de-srv.com/ http://cgi-help.virtualave.net/
------------------------------
Date: Thu, 1 Jul 1999 22:07:58 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: Perl/CGI seems an inconsistant language...
Message-Id: <MPG.11e6052c49a836d8989ad4@news-server>
T Hite writes ..
>This is exactly what would be expected. However, if I run
>the HTML file above thru the Apache 1.3 web server running
>under RedHat Linux 5.2, then I get different results:
Tom ..
I have no idea what Martin thought he was talking about in his followup
.. I don't think he understood what your expectations were
you are right .. this piece of code runs differently when run via CGI and
from the command line .. this probably seems like an inconsistency .. but
it is not .. the reason for it is quite simple
CGI is not your shell .. in other words - CGI programs are not passed to
your shell for interpretation before the output is returned .. the
shebang syntax at the top of a perl script (#!/usr/bin/perl) is handled
by an Apache feature so it appears to be identical to your shell's
processing of this file .. but it is not
so in your code - if you change this line
$sayit2 = `sayit2`;
to this (assuming the default path to perl)
$sayit2 = `/usr/bin/perl sayit2`;
then your script will work .. in fact assuming that the user context that
Apache runs in has the path to your perl interpreter in it's PATH envar
you can just type `perl sayit2`
this problem is not limited to calling perl scripts .. any interpreted
script will have the same problem .. you will find the same problem with
a shell script .. you can test this quickly by replacing the contents of
the file 'sayit2' with a shell command (like 'ls') .. and then try
running your main script from both the command shell and via CGI .. you
will see the ls output in the shell .. but not in CGI
but now change the command in $sayit2 to be `/bin/sh sayit2` .. and it
will work .. because now you're actually issuing a command without
relying on the shell
btw .. you should get into the habit of doing this for non CGI targeted
scripts as well .. it will make your scripts more portable .. imagine
(heaven forbid) that you moved a perl script to a Win32 platform ..
that platform has no shebang support .. so whammo .. any script calling
another script using your example method would stop working
--
jason - remove all hyphens for email reply -
------------------------------
Date: 01 Jul 1999 14:57:56 +0200
From: Haakon Alstadheim <haakon.alstadheim@sds.no>
Subject: Re: Perl/CGI seems an inconsistant language...
Message-Id: <uhfno5xyj.fsf@sds.no>
A string in back-ticks is run in almost the same way as
a "system" command. Look at the docs for system
(i.e run perldoc -f system from your command-shell).
Pay special attention to error reporting. Now insert
some error reporting into your first perl-script.
My bet is that you'll find that sayit2 is not found.
If that is the case you may doctor your $ENV{PATH},
or you may replace "sayit2" with "/cgi-bin/sayit2".
Note that your cgi-bin directory may be mounted at
a different place depending on wheter you run from
your own account or from the webserver account. To
find out about such things cunsult documentation or
newsgroups pertaining to your webserver. Also read
up on the filesystems that is used on your server-
machine.
Perl newsgroup is not the right forum.
------------------------------
Date: Thu, 01 Jul 1999 13:58:19 +0200
From: distler <td90537@hotmail.com>
Subject: Re: Premature end of script headers:
Message-Id: <377B57DB.55AED059@hotmail.com>
The first time the script is properly executed.
The message premature end of scrit header means that your script is not seen as
java script but as a simple html page.
So either your cgi-script has no execute permission or it is not in the cgi-bin
directory.
I think that is your problem.
Try the cpan page for more information about perl.
Let me know about the result of this via email.
Regards,
Thomas
Mike Lansing wrote:
> Ok whats with this? I am somewhat young at the perl site of programming. I
> have the same script on two diffrent servers...one works the other doesn't
> so it goes with out fail that something on my code that talks to the server
> is off its block..
>
> Premature end of script headers:
> /mnt/web/guide/thepunkpage/cgibin/submit_form.cgi
>
> thats the error I recieve. is there any good tuts or help files that teach
> an idiot like myself what to do in this case?!?! my code is 4 blocks long
> so I wont post it....
>
> - Mike
> http://come.to/NodProgrammingInc
> mycheese@kconline.com
------------------------------
Date: Thu, 01 Jul 1999 14:00:00 +0200
From: distler <td90537@hotmail.com>
Subject: Re: Premature end of script headers:
Message-Id: <377B583F.39CC8FCD@hotmail.com>
I meant perl script not java script sorry
distler wrote:
> The first time the script is properly executed.
> The message premature end of scrit header means that your script is not seen as
> java script but as a simple html page.
> So either your cgi-script has no execute permission or it is not in the cgi-bin
> directory.
>
> I think that is your problem.
>
> Try the cpan page for more information about perl.
> Let me know about the result of this via email.
>
> Regards,
>
> Thomas
>
> Mike Lansing wrote:
>
> > Ok whats with this? I am somewhat young at the perl site of programming. I
> > have the same script on two diffrent servers...one works the other doesn't
> > so it goes with out fail that something on my code that talks to the server
> > is off its block..
> >
> > Premature end of script headers:
> > /mnt/web/guide/thepunkpage/cgibin/submit_form.cgi
> >
> > thats the error I recieve. is there any good tuts or help files that teach
> > an idiot like myself what to do in this case?!?! my code is 4 blocks long
> > so I wont post it....
> >
> > - Mike
> > http://come.to/NodProgrammingInc
> > mycheese@kconline.com
------------------------------
Date: Thu, 01 Jul 1999 14:57:44 +0200
From: Pete Gilbert <pkg@studbox.uni-stuttgart.de>
Subject: Re: Problem with cgi script and reading data...
Message-Id: <377B65C8.6C9237E8@studbox.uni-stuttgart.de>
Richie Crews wrote:
> print h1("Previous Entries");
> foreach $query (@queries) {
> print h4("Name: ",param("name"),br());
> print h4("E-mail Address: ",param("email"),br());
> print h4("Web Page Address: ",a({-href=>param("webpage")},param("webpage")),br());
> print h4("Sex: ", param("sex"),br());
> print h4("Message: ",param("message"),br());
> print hr();
> }
which query does the param function operate on? it sounds like it
always gets the data from the same query. perhaps something like:
$query->param("name")
instead of
param("name")
just a thought
--
Pete Gilbert *** email: pkg@studbox.uni-stuttgart.de
------------------------------
Date: Thu, 1 Jul 1999 11:27:52 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
Subject: Re: regex to match RCS string
Message-Id: <si3dz8wqx3.fsf@cre.canon.co.uk>
Tim Potter <Tim.Potter@anu.edu.au> wrote:
> /^(@((@@)|([^@]))*@)$/
>
> This regex works fine for small strings but for large strings (900
> lines at ~40KB) perl crashes with a segmentation fault.
Verified with Perl 5.000502 on Solaris. The minimal test case that
provokes the bug appears to be something like:
$_ = 'X' x 50000;
/(?:XX|X)*/;
I've mailed a report using perlbug.
This is similar to a regular expression bug from 5.004 where
$_ = 'X' x 30000;
/(X|X)*/;
crashed with a segmentation fault.
--
Gareth Rees
------------------------------
Date: Thu, 01 Jul 1999 12:50:49 GMT
From: hiwi1krg@iitb.fhg.de (TM Lehto)
Subject: Saving both exit status and output from a command
Message-Id: <377b5fc5.71389803@iitb>
Hello,
How can I save exit status AND output of a command? I have RTF faq and
perdoc, but couldn't find a way to do it without running command
twice. My program works like this now:
# First check that command exits without error:
system("/some/command") and die "Error!";
# Now I know I'm going to get output I expect (ie. no error
# messages),so I can save the output:
$output = `/some/command`;
...do something with $output...
is there a way to do the same without running the command twice?
Thanks,
Tomi
------------------------------
Date: Thu, 01 Jul 1999 13:26:04 +0200
From: Pete Gilbert <pkg@studbox.uni-stuttgart.de>
Subject: Re: sorting info from Hashes
Message-Id: <377B504C.662C10CA@studbox.uni-stuttgart.de>
Michboy832 wrote:
>
> Ok, I want to print data from a hash into an email, but when I do this, the
> info comes up randomly on the email. How would I manipulate this into the
> order I want?
>
> Steve Peters
how bout:
foreach $key (sort keys %hash) {
print $hash{$key};
}
or if you want sorted values
print sort values %hash;
--
Pete Gilbert *** email: pkg@studbox.uni-stuttgart.de
------------------------------
Date: 1 Jul 1999 12:41:14 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: use posix
Message-Id: <377b53da@newsread3.dircon.co.uk>
Georg Edelmayer <ged@fortec.tuwien.ac.at> wrote:
> Hi,
>
> I wanted to use the ceil() fnkt in a script and therefore tried to use
> POSIX;
> Unfortunately perl tells me that the module cannot be found.
> Strange enough, as the faq and such tells that posix should be in the
> standard distributions.
> I'm using the CPAN-port for WIN32 perl 5.004_02
Its very possible that the POSIX module is not available in this particular
distribution - I would suggest that you upgrade to the latest
activestate version <http://www.activestate.com> which it appears does
include support for this module.
/J\
--
"When the boys in the playground found out that I had a potentially
fatal peanut alergy they would shove me up against a wall and make me
play Russian roulette with a bag of Revels" - Milton Jones
------------------------------
Date: Thu, 01 Jul 1999 11:57:56 GMT
From: lg@kt.dtu.dk (Lars Gregersen)
Subject: Re: Using sockets
Message-Id: <377b579a.19877565@news.dtu.dk>
On Thu, 01 Jul 1999 04:20:36 GMT, R.Joseph
<streaking_pyro@my-deja.com> wrote:
>I am using sockets for a server in Active Perl (under Win95). The
>only way I know how to handle mulitple connections to the server is by
>using fork(), which can't be used in Win32. Is there any other way to
>do this?? Thanks in advance.
Look in the documentation for the moduel IO::Select. It works on win32
and Unix.
Lars
------------------------------
Lars Gregersen (lg@kt.dtu.dk)
http://www.gbar.dtu.dk/~matlg
------------------------------
Date: Thu, 01 Jul 1999 12:39:13 +0100
From: Robin Barooah <robin@netgates.co.uk>
Subject: Why are System V IPC calls deprecated?
Message-Id: <377B5361.4EE07929@netgates.co.uk>
Hi,
"Although System V IPC is pretty ancient, it still has some valid uses."
- Programming Perl, Larry Wall, Tom Christiansen, & Randal Schwartz; 2nd
Edition, September 1996
Can anyone explain to me why Message Queues and Semaphores are
deprecated? What alternative mechanisms are there for performing these
functions. We've been using them in a number of projects, and they seem
to handle process synchronization very well. What alternatives are
there?
Regards,
--
Robin Barooah
Technical Coordinator
City NetGates Limited
------------------------------
Date: Thu, 01 Jul 1999 12:37:10 GMT
From: haytounet@my-deja.com (Arnaud Limbourg)
Subject: Write <option> to a file
Message-Id: <377b5fc3.2029008@news.bull.fr>
Hello,
I have an html page with two <select> tag. User is able to choose a
product from <select> one and by clicking a "add" button the product
is put into the second <select> tag.
Now i want to write each option of the second select tag on a line
i.e:
Option1
Option2
Option3
i thought of
print $q->param('option[0]')
print $q->param('option[1]')
But i can't figure out if it's the right way. I tried it but it
doesn't work.
Can anybody help me on that ?
Thank you.
------------------------------
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 6189
**************************************