[7617] in Perl-Users-Digest
Perl-Users Digest, Issue: 1243 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 29 09:14:19 1997
Date: Wed, 29 Oct 97 06:01:36 -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 Wed, 29 Oct 1997 Volume: 8 Number: 1243
Today's topics:
Re: 500 server error invoking perl script <jbokma@caiw.nl>
ANNOUNCE: IndexMaker 2.0: an index.html maker from PDF, <pivari@geocities.com>
Re: Better ways to... <seay@absyss.fr>
Re: Can for loop be condensed using map()? <merlyn@stonehenge.com>
Re: chdir or something like that... (Tad McClellan)
Re: Csh to Perl converter ? (Tad McClellan)
Re: DBD-Oracle-0.47.tar.gz corrupted? <lmulcahy@nyx.net>
Re: Debugging all day, and still can't figureit out - p <Greg.Allen@csfp.co.uk>
Re: detection of first execution since login <Matthew.Rice@ftlsol.com>
Re: Editing Passwords <mark@pla.to>
Hello World gives Print Undefined? error !newbie help!! (naja)
Re: Hello World gives Print Undefined? error !newbie he (Tad McClellan)
Re: Help me optimize this functionality? (Eric Bohlman)
Re: Help me optimize this functionality? (Toutatis)
Re: Help me optimize this functionality? (Toutatis)
Re: Help me optimize this functionality? (Toutatis)
Re: Help me optimize this functionality? <seay@absyss.fr>
Help! with recursion and directories <tjt3@cornell.edu>
Re: Help! with recursion and directories <seay@absyss.fr>
Re: Help! with recursion and directories (Eric Bohlman)
Re: How to send keystrokes from Perl to Win95 app (Eric Bohlman)
In-Line images and perl <bholness@nortel.ca>
Re: Internal Server Error (Gunther E. Biernat)
Re: Internal Server Error (Toutatis)
Re: Launching Perl <seay@absyss.fr>
Re: NEWBIE QUESTION <seay@absyss.fr>
Re: No value for $OSNAME under Windows (Eric Bohlman)
perl and gifs or ftp <aktaylor@austin.ibm.com>
Re: Perl Suffix (Was: Can perl be maken to Compiler ins <merlyn@stonehenge.com>
Re: return question <seay@absyss.fr>
Re: test <seay@absyss.fr>
UKs Top Perl, Java, CGI Opportunities, ECM <vanessa@ecmcel.demon.co.uk>
Re: Web Based Calendar/ Stuffed with emails? <david.martin@biotek.uio.no>
WinNT Perl <--> Excel Help! <bill@penumbra.co.uk>
Re: Year2000 problem with localtime(); (Eric Bohlman)
Re: Year2000 problem with localtime(); <rra@stanford.edu>
Re: Year2000 problem with localtime(); (John Moreno)
Re: Year2000 problem with localtime(); (John Moreno)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 29 Oct 1997 09:04:58 GMT
From: "John Bokma" <jbokma@caiw.nl>
Subject: Re: 500 server error invoking perl script
Message-Id: <01bce449$9cf9e6a0$02521e0a@tschai>
lusk@dg-rtp.dg.com wrote in article <878084920.1309@dejanews.com>...
> Help! I'm just getting started putting up an intranet page on NT
> Workstation using the FrontPage98 demo (w/its "Personal Web
Server") and
> I'd like to use my Unix knowledge in writing a cgi-bin perl script
to
> handle the input from a form. I'm interested in getting results
fast,
> and I don't feel like writing a C program to do what cgi-lib
already does
> for me (and what Perl already does, for that matter).
>
> However, when I invoke a url to a simple hello world script
> (http://<host>/cgi-bin/hello.pl), I get a 500 server error, and the
error
> log sez:
>
> httpd: could not create new process: 193
I guess that the server has no rights to start the process. CHMOD 705
hello.pl.
Some servers require the script to end in .cgi. Also, check the first
line of
your script. It must read: #!/path/to/perl
(with /path/to/ the directory which contains perl, e.g.
/usr/local/bin/)
You can check the script from the prompt with perl -wc hello.pl and
you
must be able to run it directly, i.e. hello.pl must write some output
to your screen.
John
--
----------------------------------------------------------------------
------
C A S T L E A M B E R Freelance Software Development
(Java/Perl/C/CGI)
http://www.caiw.nl/~jbokma/ [Java demo's,Perl scripts,Xara graphics,
Resume]
mail:jbokma@caiw.nl phone: +31 10 4291827
------------------------------
Date: Wed, 29 Oct 1997 10:52:16 +0000
From: Fabrizio Pivari <pivari@geocities.com>
Subject: ANNOUNCE: IndexMaker 2.0: an index.html maker from PDF, HTML and other files
Message-Id: <34571560.4487@geocities.com>
Hi,
I'm glad to announce the version 2.0 of IndexMaker a perl script to make
an index.html file from PDF, HTML and other files.
At the moment, it uses the /Author field and the first /Title field in
every matched PDF files, the <TITLE> </TITLE> field in every matched
HTML files and the name of the file in the others.
It should work with PERL 4 and 5.
What's new with version 2.0
New input files format: HTML, OTHER
This is the URL where you can find the tool
http://www.geocities.com/CapeCanaveral/Lab/3469
Enjoy it!
Send me your suggestions.
--
_/_/_/_/ _/_/_/ Fabrizio Pivari
_/ _/ _/ mailto:pivari@hotmail.com
_/_/_/ _/_/_/ mailto:pivari@geocities.com
_/ _/ http://www.geocities.com/CapeCanaveral/Lab/3469/
_/ _/
------------------------------
Date: Wed, 29 Oct 1997 10:16:47 +0100
From: Doug Seay <seay@absyss.fr>
Subject: Re: Better ways to...
Message-Id: <3456FEFF.7C7727D0@absyss.fr>
Eli the Bearded wrote:
>
> Fewer keystrokes required; backwards compatible to perl 4.
Eli, while I appreciate the former, the later is irrelevant except as a
historical oddity.
- doug
PS - Why do you cross-post everything to your fan group? Just to make
sure you don't miss anything here?
------------------------------
Date: 29 Oct 1997 06:49:09 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: plussier@wellfleet.com (Paul L. Lussier)
Subject: Re: Can for loop be condensed using map()?
Message-Id: <8czpnsadd6.fsf@gadget.cscaper.com>
>>>>> "Paul" == Paul L Lussier <plussier@wellfleet.com> writes:
Paul> Hi, I currently have this for loop which takes a hex mac address and converts
Paul> it into a dotted quad format and I'm looking for a more efficient way of doing
Paul> the same thing:
Paul> $mask = 'ffffff00'
Paul> for ($i=0; $i < length ($mask); $i+=2) {
Paul> push (@newmask, hex (substr ($mask, $i,2)));
Paul> }
Paul> $netmask = join ('.', @newmask);
You mean, something like:
$netmask = join ".", map hex, $mask =~ /(..)/g;
perhaps?
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 307 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Wed, 29 Oct 1997 08:07:34 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: chdir or something like that...
Message-Id: <6vf736.rk.ln@localhost>
rp11179@online-club.de wrote:
: sorry, but I'm just a perl beginner ;-)
Even beginners can use the docs.
: Is it possible to use the chdir within a perl program and let this
: affect the parent program?
No.
: I hope anybody can get what I mean :-)
We know what you mean, because we have seen this question MANY
times before.
Perl FAQ, part 8:
----------------------------------
=head2 I {changed directory, modified my environment} in a perl script. How come the change disappeared when I exited the script? How do I get my changes to be visible?
=over 4
=item Unix
In the strictest sense, it can't be done -- the script executes as a
different process from the shell it was started from. Changes to a
process are not reflected in its parent, only in its own children
created after the change. There is shell magic that may allow you to
fake it by eval()ing the script's output in your shell; check out the
comp.unix.questions FAQ for details.
=item VMS
Change to %ENV persist after Perl exits, but directory changes do not.
=back
----------------------------------
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 29 Oct 1997 08:12:31 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Csh to Perl converter ?
Message-Id: <f8g736.rk.ln@localhost>
mark hutchinson (markh@manhatten.prestel.co.uk) wrote:
: does anyone have a (preferably perl) script to convert a C-shell script to
: Perl???
Perl FAQ, part 8:
"How can I convert my shell script to perl?"
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: 29 Oct 1997 06:21:25 -0700
From: Larry Mulcahy <lmulcahy@nyx.net>
Subject: Re: DBD-Oracle-0.47.tar.gz corrupted?
Message-Id: <oqoh48r9gq.fsf@nyx.net>
I tried a few more times (getting a different site each time) and
finally managed to get a good copy of DBD-Oracle-0.47.tar.gz.
Netscape has some problems, but downloading binary files in ASCII mode
isn't one of them. I've successfully downloaded hundreds of .tar.gz
files, images, etc. with Netscape.
--
Larry Mulcahy lmulcahy@nyx.net lmulcahy@dimensional.com
http://www.nyx.net/~lmulcahy/ http://www.geocities.com/Area51/Zone/9653/
------------------------------
Date: Wed, 29 Oct 1997 10:02:31 +0000
From: Greg Allen <Greg.Allen@csfp.co.uk>
Subject: Re: Debugging all day, and still can't figureit out - please help
Message-Id: <345709B7.7948@csfp.co.uk>
warren.milburn@cdtec.co.uk wrote:
> Whereas this line (below), which has been adapted from the above gives
> the error "Backslash found where operator expected at people.pl line
> 174, near "= split (/\" .... (Missing Operator before \?) ....
>
> ($staff_no, $forename, $surname, $job_title, $company, $department) =
> split (/\0/, $fields);
>
> Any suggestions you might have would be gratefully received.
I reckon the problem lies in the preceeding lines of the script. Perhaps
a missing semi-colon on the line above? I use the auto-indent feature of
cperl mode in Xemacs to help spot these. I can run the line above with
out problems in isolation in the debugger "perl5 -de 0"
_____________________________________________________
Greg Allen
OTC Settlement Systems
Credit Suisse Financial Products
------------------------------
Date: 28 Oct 1997 17:02:33 -0500
From: Matthew Rice <Matthew.Rice@ftlsol.com>
Subject: Re: detection of first execution since login
Message-Id: <m32015mtqe.fsf@hudson.ftlsol.com>
Chenyang Xu <chenyang@mashie.ece.jhu.edu> writes:
> Many thanks for your input. I am using a SGI workstation. What I am trying
> to accomplish is to write a simple message script using perl. The script
> is put in the .login (or .cshrc). I only want my message to be displayed
> when I login. Without a detection of first execution since login, my
> message will be displayed everytime when I open a new window which is
> quite annoying. I have tried to put it in the .profile but it doesn't
> work. I suspect it is because I am using "tcsh" instead of "sh" although I
> am not sure.
>
> Any other input or alternative way to achieve this will be greatly
> appreciated!
Doesn't SGI have a /etc/motd? Try: man motd
--
Matthew Rice e-mail: matthew.rice@ftlsol.com
------------------------------
Date: 29 Oct 1997 09:35:48 GMT
From: <mark@pla.to>
Subject: Re: Editing Passwords
Message-Id: <01bce44d$91207750$064300c3@archive>
Tom Phoenix <rootbeer@teleport.com> wrote in article
<Pine.GSO.3.96.971025062944.8796D-100000@usertest.teleport.com>...
> On Sat, 25 Oct 1997, Mic wrote:
>
> > Does anyone know where I can find a program that with add, change &
> > delete passwords from the file .htpasswd.
>
> 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/
Mic, you might want to fetch HyperNews at
http://union.ncsa.uiuc.edu/hypernews. It is a set of perl programmes which
sets up a type of message boards on a web-server. In this source, they have
parts which create, modify(?) and delete lines in .htpasswd files.
mark@pla.to http://mind.pla.to - de site voor tweede hands computers en
computer-onderdelen
------------------------------
Date: Wed, 29 Oct 1997 11:20:15 -0000
From: naja@eirlink.com (naja)
Subject: Hello World gives Print Undefined? error !newbie help!!!
Message-Id: <MPG.ec12c4c230fc113989683@news.indigo.ie>
chmod is ok, paths ok, other basic prereq's are ok.
I can run scripts, but they wont print to the screen.
So, I went back to the basic 'Hello world' program but it gives me an
error, saying print function is undefined.
If I could see a working example, I could take things from there,
but right now, I've pored over 3 books, numberous FAQ's, and my eyes are
red and sore from RTFM'ing.
Any ideas?
thanks in advance!
naja
------------------------------
Date: Wed, 29 Oct 1997 08:13:50 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Hello World gives Print Undefined? error !newbie help!!!
Message-Id: <uag736.rk.ln@localhost>
naja (naja@eirlink.com) wrote:
: So, I went back to the basic 'Hello world' program but it gives me an
: error, saying print function is undefined.
: Any ideas?
One idea might be to post broken code if you want someone to
troubleshoot said broken code.
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 29 Oct 1997 10:19:02 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Help me optimize this functionality?
Message-Id: <ebohlmanEIt5zr.70E@netcom.com>
Mattias Lvnnqvist (mattias.lonnqvist@-NO-SPAM-.uidesign.se) wrote:
: Currently I have a small function which translates certain sequences of
: chars,
: or to be precise, it translates %0a - %ff to upper caps.
[snip]
: Now, this is real ugly. Its also a very solution, seen to complexity,
: since I have 60 loops to do this.
: This probably could be done with a neat translation or substitution, but
: I just cant figure how.
s/%((0[a-f])|[1-9a-f][0-9a-f])/%\U$1/g;
ought to do the trick.
------------------------------
Date: 29 Oct 1997 10:40:58 GMT
From: toutatis@_SPAMTRAP_toutatis.net (Toutatis)
Subject: Re: Help me optimize this functionality?
Message-Id: <toutatis-ya023180002910971140580001@news.euro.net>
Mattias.Lonnqvist@-NO-SPAM-.uidesign.se wrote:
> Currently I have a small function which translates certain sequences of
> chars,
> or to be precise, it translates %0a - %ff to upper caps.
>
> My current function looks like this:
>
> sub capit
> {
> $testdata = $_[0];
> $j='a';
>
> for ($i=0; $i<10; $i++){
> for (('a','b','c','d','e','f')){
> $j=$_;
> $j =~ tr/a-f/A-F/;
> $testdata =~ s/\%$i$_/\%$i$j/g;
> $testdata =~ s/\%$_$i/\%$j$i/g;
> $testdata =~ s/\%$_$_/\%$j$j/g;
> }
> }
> return $testdata;
> }
Probably
s/%([\da-fA-F]{2})/lc(pack('c', hex ($1))/ge;
would do what you want.
--
Toutatis
------------------------------
Date: 29 Oct 1997 10:47:01 GMT
From: toutatis@_SPAMTRAP_toutatis.net (Toutatis)
Subject: Re: Help me optimize this functionality?
Message-Id: <toutatis-ya023180002910971147030001@news.euro.net>
I wrote earlier:
> Probably
> s/%([\da-fA-F]{2})/lc(pack('c', hex ($1))/ge;
> would do what you want.
Oops, you wanted uppercase, so make that:
s/%([\da-fA-F]{2})/uc(pack('c', hex ($1))/ge;
--
Toutatis
------------------------------
Date: 29 Oct 1997 10:51:26 GMT
From: toutatis@_SPAMTRAP_toutatis.net (Toutatis)
Subject: Re: Help me optimize this functionality?
Message-Id: <toutatis-ya023180002910971151280001@news.euro.net>
I wrote earlier:
> I wrote earlier:
>
> > Probably
> > s/%([\da-fA-F]{2})/lc(pack('c', hex ($1))/ge;
> > would do what you want.
>
> Oops, you wanted uppercase, so make that:
> s/%([\da-fA-F]{2})/uc(pack('c', hex ($1))/ge;
And add another bracket as well :-)
s/%([\da-fA-F]{2})/uc(pack('c', hex ($1)))/ge;
--
Toutatis
------------------------------
Date: Wed, 29 Oct 1997 14:10:53 +0100
From: Doug Seay <seay@absyss.fr>
Subject: Re: Help me optimize this functionality?
Message-Id: <345735DD.1763E0A2@absyss.fr>
> Mattias.Lonnqvist@-NO-SPAM-.uidesign.se wrote:
>
> > Currently I have a small function which translates certain sequences of
> > chars,
> > or to be precise, it translates %0a - %ff to upper caps.
Toutatis wrote:
>
> Probably
> s/%([\da-fA-F]{2})/lc(pack('c', hex ($1))/ge;
> would do what you want.
Close, but I think
s/(%[\da-fA-F]{2})/uc($1)/ge;
will work better.
- doug
------------------------------
Date: Tue, 28 Oct 1997 20:07:34 -0500
From: Tim <tjt3@cornell.edu>
Subject: Help! with recursion and directories
Message-Id: <34568C56.ABD@cornell.edu>
Okay, this may in fact be an RTFM question (if so, please just point me
to the proper section and I'll look it up), but here goes:
I wrote a Perl script to look for core dumps and emacs ~ files a while
ago. I want to modify it so it goes to my user directory and
recursively chdir()'s to each subdirectory, looking for core and *~
files in each, deleting them, and logging the results.
I can do everything but the recursion, and I have stuffed all the
operations to be done in each directory into subroutines. Duh. But how
do I either:
spawn a process for each directory found, and have it repeat until each
process has run out of subdirectories beside . and .., then kill them?
or
something simpler where I don't have to use child processes?
Any advice would be greatly appreciated! I will check the newsgroup,
but if you felt like cc'ing me an email, I'd appreciate that.
Thanks in advance to anyone who helps.
--
Tim
"We don't like their sound, and guitar music is on the way out."
--Decca Recording Co. rejecting the Beatles, 1962.
------------------------------
Date: Wed, 29 Oct 1997 11:20:58 +0100
From: Doug Seay <seay@absyss.fr>
To: Tim <tjt3@cornell.edu>
Subject: Re: Help! with recursion and directories
Message-Id: <34570E0A.5C67A10A@absyss.fr>
[posted and mailed]
Pruning comp.lang.misc.perl 'cause it don't exist.
Tim wrote:
> I can do everything but the recursion, and I have stuffed all the
> operations to be done in each directory into subroutines. Duh. But how
> do I either:
>
> spawn a process for each directory found, and have it repeat until each
> process has run out of subdirectories beside . and .., then kill them?
Unclean! This will cause you to be cursed unto the third generation.
This can be done fairly easily, but don't even try it.
> something simpler where I don't have to use child processes?
What about recusion makes you think you need to spawn a child process?
You didn't fork() processes when recusively traversing binary trees back
in freshman intro to programming, did you? Of course not, so don't do
it here either. For recusion, just use a list and push() on the places
you need to go, and use pop() to find your next destination. Maybe keep
a been_there_done_that hash so you don't get into any infinite loops due
to symbolic links.
But the real solution is much simplier.
perldoc File::Find
This should give you what you want.
- doug
------------------------------
Date: Wed, 29 Oct 1997 11:04:25 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Help! with recursion and directories
Message-Id: <ebohlmanEIt83D.8GD@netcom.com>
Tim (tjt3@cornell.edu) wrote:
>Newsgroups: comp.lang.misc.perl,comp.lang.perl.misc
"comp.lang.misc.perl" doesn't exist.
: Okay, this may in fact be an RTFM question (if so, please just point me
: to the proper section and I'll look it up), but here goes:
: I wrote a Perl script to look for core dumps and emacs ~ files a while
: ago. I want to modify it so it goes to my user directory and
: recursively chdir()'s to each subdirectory, looking for core and *~
: files in each, deleting them, and logging the results.
: I can do everything but the recursion, and I have stuffed all the
: operations to be done in each directory into subroutines. Duh. But how
: do I either:
It is an RTFM question, and File::Find is the answer.
------------------------------
Date: Wed, 29 Oct 1997 10:42:39 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: How to send keystrokes from Perl to Win95 app
Message-Id: <ebohlmanEIt733.7rE@netcom.com>
Ronald L. Parker (ron@farmworks.com) wrote:
: On 27 Oct 1997 14:00:45 GMT, "L. Dwynn Lafleur" <lafleur@usl.edu>
: wrote:
: >Is it possible to send keystrokes from a running Perl script to a Win95
: >application that the script has opened? For example, from a Perl script,
: >can I open Notepad and then issue a command in the script to insert a text
: >string into the Notepad document?
: Try using Win32::API and use the SendMessage or PostMessage function.
: You might need to get your hands on an SDK reference, and the whole
: thing might be a bit of work, but it can be done.
Using SendMessage() or PostMessage() aren't particularly good ways of
sending keystrokes to applications because they bypass a bunch of queuing,
translation and state-maintenance mechanisms. The best way (for
relatively small numbers of keystrokes) is to call keybd_event() which is
actually the routine that keyboard drivers call to enter keystrokes into
the system. It will be necessary to do a bit of translation involving
scan codes and the like, but that should be easy to accomplish.
If you're talking about long sequences of keystrokes, you'll have to use
more complicated methods (usually based on "journal playback hooks") in
order to avoid buffer overruns; unfortunately, keybd_event doesn't return
an indication of whether or not there was room for the "keystroke."
Someone who's got more (i.e. any) experience in writing C extensions to
Perl ought to consider writing a Win32::SendKeys module to emulate the
SendKeys function found in Visual Basic and related languages.
------------------------------
Date: Wed, 29 Oct 1997 13:08:36 +0000
From: Ben Holness <bholness@nortel.ca>
Subject: In-Line images and perl
Message-Id: <34573554.2BD1@nortel.ca>
Hi
Does anyone know how to make perl output as an inline image?
As always, an example will make things clearer:
Perhaps you know how a web page counter works? you have
<img src="cgi-bin file">, and the cgi file outputs an image.
I would like to do a similar thing in perl, but it is not a counter
for web pages, hence I cannot use the web-page counters.
I thought it would be possible simply to open the image file and then
output it to html, but this did not seem to work.
Any suggestions would be appreciated.
-Perhaps someone has some source code for a web counter in PERL that
I could base my program on? :)
Cheers
Ben
-=* Ben Holness can be mailed at:% bholness@nortel.ca *=-
------------------------------
Date: 28 Oct 1997 00:02:41 GMT
From: GEBiernat@t-online.de (Gunther E. Biernat)
Subject: Re: Internal Server Error
Message-Id: <633a31$s1c$1@news01.btx.dtag.de>
On Mon, 27 Oct 1997 12:27:09, drizzt@drizzt.stny.lrun.com wrote:
> In setting up scripts on my server, I keep getting
> an error 500, or 'Internal Server Error'..
> Does anyone know what the reason for this is?
The "Internal Server Error" is what you'll get from the HTTP server
whenever a script fails to give a _correct_ and _complete_ result.
Normally, you send some information from a HTML document to a script.
The script replies with some results, the HTTPd passes these results
to your browser. If there was an error (of any type, for whatever
reason) in your script, you'll get an "Internal Server Error" since
the Perl error message is _not_ automatically passed to you.
So do the following:
TELNET your server, login.
Change into the subdirectory where your script is located (likely
cgi-bin).
Run your script (type it's name and hit ENTER)
Normally you'll get a much better error message...
Good luck!
Bye/2
------------------------------
Date: 29 Oct 1997 13:02:04 GMT
From: toutatis@_SPAMTRAP_toutatis.net (Toutatis)
Subject: Re: Internal Server Error
Message-Id: <toutatis-ya023180002910971402030001@news.euro.net>
GEBiernat@bauwesen.de wrote:
> The "Internal Server Error" is what you'll get from the HTTP server
> whenever a script fails to give a _correct_ and _complete_ result.
Could you unveil the manufacturer of such a server, that checks output for
being correct and complete?
--
Toutatis
------------------------------
Date: Wed, 29 Oct 1997 10:46:08 +0100
From: Doug Seay <seay@absyss.fr>
To: Robert Collins <figuro@sprintmail.com>
Subject: Re: Launching Perl
Message-Id: <345705E0.29FEB8FD@absyss.fr>
[posted and mailed]
[deleted comp.lang.perl because it doesn't exist]
Robert Collins wrote:
>
> Hi there: Now that I installed and tested perl on this
> Linux machine how do I get output or launch it ??
> Or, where do I get the instructions ?? Thanks
If you installed it in a directory that is in your PATH variable, just
perl /path/to/script
something like
perl ~/bin/count
If your script starts with #!, then you could simply put
~/bin/count
to run it. If this directory is in your path (and most people keep
~/bin in the PATH), that could be reduced down to
count
"output" is a very tricky question. Perl likes stdin/stdout, but many
programs manipulate sockets and/or files, so there is no visible
output. Perl/Tk programs create windows, but if your DISPLAY variable
points somewhere else, you'll never see them.
It sounds like you should go buy "Learning Perl" by Randal Schwartz and
read it. I think it will answer some questions that you haven't even
thought about yet. If you already have a good programming background,
just get the Camel (aka "Programming Perl") by Wall, Schwartz and
Christansen. The ISBNs are availble with "man perlbook", or go to your
favorite bookstore that carries the ORA books.
- doug
------------------------------
Date: Wed, 29 Oct 1997 11:29:36 +0100
From: Doug Seay <seay@absyss.fr>
Subject: Re: NEWBIE QUESTION
Message-Id: <34571010.5049CD2D@absyss.fr>
Rabbid One wrote:
>
> I've got a perl script going on via DOS. My questions are:
>
> I'd like to set up a situation where I've got a 2 frame page up that a
> user can input something in frame 1 and the perl script works it and
> answers on frame 2. Is this possible?
>
> I noticed that if I say
>
> $x=1;
>
> and then later do a
>
> if ($x=1)
>
> then the if comes up false but if I do a
>
> if ($x="1")
>
> it works fine. Is this normal?
The abnormal thing here is you using = (assignment) when you should be
using == (numeric comparison) or eq (string comparison).
if ( $x=1 )
should evaluate the same as
if ( 1 )
with the side effect of $x changing value, so I think you have your true
and false mixed up in your posting. Try adding that second = in those
if statements. If that doesn't work, try posting a few lines.
- doug
PS - "NEWBIE QUESTION" is about the worst possible subject. There is a
mini-FAQ posted twice a week that explains what good and bad subject
lines are. Netiquette says that folks should read groups for a few
weeks before posting so they can read the local FAQs and find out about
the "native culture" before posting. This isn't intended as a flame,
just as a piece of advice on using USENET.
------------------------------
Date: Wed, 29 Oct 1997 11:08:28 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: No value for $OSNAME under Windows
Message-Id: <ebohlmanEIt8A4.8L4@netcom.com>
Chipmunk (rjk@coos.dartmouth.edu) wrote:
: I've run into a problem with the special variable $OSNAME under Windows.
: Basically, the variable has no value.
[snip]
: perl v5.001, unofficial patchlevel 1m.
That's pretty old. Mine (Gurusamy Sarathy's 5.004_01) comes up with
"MsWin32" for $OSNAME.
------------------------------
Date: Tue, 28 Oct 1997 14:54:14 -0600
From: Andrew Taylor <aktaylor@austin.ibm.com>
Subject: perl and gifs or ftp
Message-Id: <345650F6.167E@austin.ibm.com>
I would like to be able to read in a manipulate a gif file in perl!
Does anyone know of any perl modules that already allow you to do this?
Also, I would like my perl script to be able to ftp (not tftp) to an ftp
server, login as some user/password, and then do puts and gets. Anyone
know of any perl modules that already do this?
-- Andrew
------------------------------
Date: 29 Oct 1997 06:41:40 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Perl Suffix (Was: Can perl be maken to Compiler instead of interpreter?)
Message-Id: <8c3elkbsa3.fsf@gadget.cscaper.com>
>>>>> "Andrew" == Andrew Johnson <ajohnson@gpu.srv.ualberta.ca> writes:
Andrew> I generally use a .pl extension on my perl scripts so my editor
Andrew> (which recognizes extensions) is in perl-mode when I open them.
If you're editor is Emacs, you can train it to notice the #! line as
well. If your editor *isn't* Emacs, why not? :-)
I get a queasy feeling in my stomach whenever I see a Perl *script*
that ends in ".pl". It just looks plain ugly. That'd be like
naming /bin/cat as /bin/cat.c or /bin/true as /bin/true.sh. Yuck!
Why should the invoker care that it was written in Perl?
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 307 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Wed, 29 Oct 1997 11:08:48 +0100
From: Doug Seay <seay@absyss.fr>
Subject: Re: return question
Message-Id: <34570B30.610836D7@absyss.fr>
Faust Gertz wrote:
>
> On Tue, 28 Oct 1997 19:28:29 -0500, Joe Gottman
> <joegottman@worldnet.att.net> wrote:
>
> >I have a question about the return keyword. Is there any difference
> >between the
> >function
> > sub foo { 1;}
> >and
> > sub foo {return 1;}
> >
> > I like using return as the last statement in a subroutine, but I am
> >curious if
> >this would cause the function to run slower or faster.
>
> About six letters. You could also just write:
>
> sub foo { 1 }
>
> to save more typing. As far as one running faster than the other, I
> can't see any reason for a difference in performance, but the only way
> to be sure is to use the Benchmark module and see for yourself.
The classic Camel said that implicit return is a bit faster than the
explicit return. Since this isn't mentioned in modern Camel, I'd guess
that the two are the same for perl5, but I still avoid the "return"
because I learned back in the perl4 days (bad habit?). Another way to
do this would be
use constant foo => 1;
which is really a funny a subroutine that can be inlined so it can be
used in constant folding which might improve your run time a tiny bit in
some cases. But this approach does require a few more characters worth
of typing. You can't have everything.
- doug
------------------------------
Date: Wed, 29 Oct 1997 10:07:56 +0100
From: Doug Seay <seay@absyss.fr>
To: Joseph June <jjune@miday.uchicago.edu>
Subject: Re: test
Message-Id: <3456FCEC.70DAC443@absyss.fr>
Joseph June wrote:
>
> test
you failed
------------------------------
Date: Wed, 29 Oct 1997 09:53:32 +0000
From: ECM Selection Ltd <vanessa@ecmcel.demon.co.uk>
Subject: UKs Top Perl, Java, CGI Opportunities, ECM
Message-Id: <3YvT0NAcewV0EwGa@ecmcel.demon.co.uk>
The UKs Top Perl, Java, CGI Opportunities
PhD, MSc, 1st Class, 2.1 Hons?
For the pick of the UKs most challenging opportunities in:
Network Security
Messaging
Search Agents / Robots
User Interfacing
visit: http://www.ecmsel.co.uk
For further information on ECM and to search our ONLINE VACANCY DATABASE visit
http://www.ecmsel.co.uk.
Please contact us by Email (CVs in plain ASCII text - not coded!)
topjob@ecmsel.co.uk.
Alternatively Snail, Fax or Phone:
ECM Selection Ltd, The Maltings, Burwell, Cambridge, CB5 0HB
Phone: 01638 742244 Fax: 01638 743066
------------------------------
Date: Wed, 29 Oct 1997 11:47:47 +0100
From: David Martin <david.martin@biotek.uio.no>
Subject: Re: Web Based Calendar/ Stuffed with emails?
Message-Id: <34571453.6B782675@biotek.uio.no>
Dale Phillips wrote:
>
> Hello all,
>
> Has anyone done this? A Formatted email is sent to an alias,
> a cronjob checks for incoming, perlizes it into html for
> everyones pursal.
>
> I have the first few steps noodled out but "how to display a
> calendar from a web has me confused.'
I did a similar thing, just using a fill out form instead of email (I
will stick the email in when I get around to it.)
All you need to do is to sort your info (or references to it) into a
nice flat file database as it arrives, then just read through the
database and print it out in your predetermined format. I use a CGI
script to read the database, but it is just as easy to write the whole
thing out as static HTML to a file.
You could have a look at http://www.no.embnet.org/holmes/holmes.cgi to
see the CGI in action. Not too bad for the second perl script I wrote in
that it works and the output looks pretty.. I'd hate to be able to read
the mind of a perl purist looking at my code though..
You have to think carefully about what information you want to display
and set up the records accordingly.
..d
--
* David Martin - Atherosclerosis and Thrombosis research group *
* http://www.uio.no/~damartin/ david.martin@biotek.uio.no *
* Lab +47 22 95 84 54 Fax +47 22 69 41 30 GSM +47 90 74 27 65 *
------------------------------
Date: 29 Oct 97 11:54:09 GMT
From: "Bill Parker" <bill@penumbra.co.uk>
Subject: WinNT Perl <--> Excel Help!
Message-Id: <01bce458$d7ce2e80$5c053cc3@penumbra.powernet.co.uk>
Hi,
Has anyone got any examples or details of accessing Excel spreadsheets from
WinNT perl 5.004? Or Web pages I can look at?
I'm trying to use perl to generate HTML based on config data held in an
Excel spreadsheet.
I've read thru' 'Learning Perl on Win32 Systems' and am reasonably fluent
using perl on UNIX systems.
But I need some help getting perl to open up and read an existing Excel
spreadsheet. Preferably one with multiple worksheets and so on. I presume I
have to use OLE or ActiveX or whatever it is now called but I've no idea
what Automation Objects terms are available or what they do. I'm pretty
vague on all this. Maybe Visual Basic help would do, if it's easy enough to
convert to perl format???
Any help, as ever, gratefully received.
Bill
--
Boggies are an unattractive but annoying people whose numbers have
decreased rather precipitously since the bottom fell out of the
fairy-tale market. Slow and sullen, and yet dull, they prefer to
live simple lives of pastoral squalor. Bored of the Rings.
------------------------------
Date: Wed, 29 Oct 1997 10:25:24 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Year2000 problem with localtime();
Message-Id: <ebohlmanEIt6AC.7CB@netcom.com>
Abigail (abigail@fnx.com) wrote:
: Uhm, if I have my application read and write dates, using
: sizeof (time_t) space, I get a problem when sizeof (time_t)
: isn't constant over time.
: One of the subproblems of Y2K is that going from 2 to more bytes to
: store the year gives problems when reading old data, or writing new data.
: That same problem will hit machines when their time_t type goes from 32
: to 64 bits.
With a 40-year head start, I would hope that programmers would start
storing dates as long integers and casting their time_t's to them (with
appropriate sign extension for pre-1970 dates). Of course, *that* code
will have to be changed before dates start overflowing a 64-bit word :).
------------------------------
Date: 29 Oct 1997 02:51:18 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Year2000 problem with localtime();
Message-Id: <m3zpnsvo49.fsf@windlord.Stanford.EDU>
Eric Bohlman <ebohlman@netcom.com> writes:
> With a 40-year head start, I would hope that programmers would start
> storing dates as long integers and casting their time_t's to them (with
> appropriate sign extension for pre-1970 dates). Of course, *that* code
> will have to be changed before dates start overflowing a 64-bit word :).
Somehow, I'm not all that worried about a year 292471210647 problem. :)
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Wed, 29 Oct 1997 08:34:10 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: Year2000 problem with localtime();
Message-Id: <1997102823562553891440N@roxboro-178.interpath.net>
<lvirden@cas.org> wrote:
] According to John Moreno <phenix@interpath.com>:
] :Can anybody come up with a way that a compiler or a compiler portion
] :of a IDE could have the Y2P? Not the libraries, or the code
] :generated, but the compiler itself. Now "make" could have a problem
] :- not likely but
]
] If you want to know possible scenarios, how about:
]
] a compiler which compiles .h files when they have been updated but
] formats date and time using a 2 digit year ascii string instead of
] using a time_t value?
Nope, because what would be tested for is EQUALITY with the last date,
not that it was greater - if it tested that the current modification
date was later than the last modification date then it would have a
general problem. I.e. when a .h file is replaced by a older file
because of some problem - it would never get re-compiled, which could be
a real bitch.
] Who really knows what possible mental abberations one might have when
] writing any program...
You should have a fair idea of the range of possibilities, by virtue of
being a programmer and knowing what is necessary, possible, and what is
only possible if the programmer is extremely insane, in relationship to
this program.
For example I couldn't write a perl interpreter off hand if my life
depended upon it - there is too much of the language I don't know about,
functions I've never heard of, and modifiers likewise. OTOH I *know*
that whatever the code looks like it has to include complex pattern
matching code, just as I **know it doesn't have any code to convert
MacPaint bitmaps into autocad files.
--
John Moreno
------------------------------
Date: Wed, 29 Oct 1997 08:35:35 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: Year2000 problem with localtime();
Message-Id: <1997102900444455628120N@roxboro-178.interpath.net>
Henry Hartley <HARTLEH1@westatNOSPAM.com> wrote:
] True. My understanding, however, is that the range for dates in perl
] is 2038. Is that not true? Try running this code:
]
] #!/usr/local/bin/perl -w
] print "Content-type: text/html\n\n";
] for ($x==0; $x<43; $x++) {
] $y = $x * (24*60*60*365.24);
] ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
] localtime(time+$y);
] $mon = $mon +1;
] $year = $year+1900;
] print "$mon, $mday, $year, $wday, $yday, $isdst, $hour, $min, $sec
] \n"; }
]
] and notice what happens in 2038. I understand this is not the same as
] the year 2000 problem but I can see where it might be a problem.
Well, using MacPerl 2038 is fine but there is a problem with 2040 - in
any case we have 40+ years to deal with the problem and most systems are
beginning to go to a 64 bit system, this will probably be complete
within 15 years.
--
John Moreno
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
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 1243
**************************************