[22175] in Perl-Users-Digest
Perl-Users Digest, Issue: 4396 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 13 18:06:25 2003
Date: Mon, 13 Jan 2003 15:05:10 -0800 (PST)
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, 13 Jan 2003 Volume: 10 Number: 4396
Today's topics:
Can't get CGI script to work locally <danmurph@worldnet.att.net>
Re: Can't get CGI script to work locally (Ben Morrow)
Re: Can't get CGI script to work locally <bongie@gmx.net>
Re: CGI - HTML Generation problems with images - script (Daniel R. Tobias)
CGI output displayed as text in Navigator (John)
Re: CGI output displayed as text in Navigator (Malcolm Dew-Jones)
Re: CGI output displayed as text in Navigator <rubin@msu.edu>
Re: CGI output displayed as text in Navigator (Ben Morrow)
Re: CGI output displayed as text in Navigator <bongie@gmx.net>
Creating PDF files that include images (Mike Solomon)
Re: FULL VERSION: Hi all gurus. What is wrong in my s <camerond@mail.uca.edu>
Re: FULL VERSION: Hi all gurus. What is wrong in my s (Tad McClellan)
Re: How does one determine why perl prog runs so slow?? (Andrew Allaire)
Re: how to redirect STDIN to such place like /dev/null <oooooops@163.com>
Re: how to redirect STDIN to such place like /dev/null (Walter Roberson)
Re: how to redirect STDIN to such place like /dev/null <QSPDVOFMGTUJ@spammotel.com>
Re: installing modules under Cygwin -- never mind! <rubin@msu.edu>
Re: My, our, etc. <jpagnew@vcu.edu>
Newbie Q: installing modules under Cygwin <rubin@msu.edu>
Perl command line processing, Windows/dos style ? (Bugs Bunny)
Re: Regenerating Activeperl html documentation <brian_helterline@hp.com>
Re: sleep aborts script <mdudley@execonn.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 13 Jan 2003 22:43:03 GMT
From: "Daniel Murphy" <danmurph@worldnet.att.net>
Subject: Can't get CGI script to work locally
Message-Id: <XhHU9.109696$hK4.8912907@bgtnsc05-news.ops.worldnet.att.net>
I'm trying to get the following trivial code to work on my Win95 machine
with IE 5.50, but I can't get the browser to display anything. The same Perl
code works OK when run from the command line. I have Perl/CGI experience on
Unix systems, but am I missing something obvious here?
test.html:
---------------------------------------------
<HTML>
<HEAD>
<TITLE>Test</TITLE>
</HEAD>
<BODY>
<!--#exec cgi="hello.cgi" -->
</BODY>
</HTML>
---------------------------------------------
hello.cgi:
---------------------------------------------
use CGI;
print "Content-type: text/html\n\n";
print "Hello";
---------------------------------------------
------------------------------
Date: Mon, 13 Jan 2003 22:45:42 +0000 (UTC)
From: mauzo@mimosa.csv.warwick.ac.uk (Ben Morrow)
Subject: Re: Can't get CGI script to work locally
Message-Id: <avvfim$44m$1@wisteria.csv.warwick.ac.uk>
"Daniel Murphy" <danmurph@worldnet.att.net> wrote:
>
>I'm trying to get the following trivial code to work on my Win95 machine
>with IE 5.50, but I can't get the browser to display anything. The same Perl
>code works OK when run from the command line. I have Perl/CGI experience on
>Unix systems, but am I missing something obvious here?
>
>
>test.html:
>---------------------------------------------
><HTML>
><HEAD>
><TITLE>Test</TITLE>
></HEAD>
><BODY>
>
><!--#exec cgi="hello.cgi" -->
What server are you using? Have you set it up to honour SSIs? What URL are you
typing into the browser, and what response (source) are you getting?
>
></BODY>
></HTML>
>---------------------------------------------
>
>
>hello.cgi:
>---------------------------------------------
>use CGI;
>
>print "Content-type: text/html\n\n";
>print "Hello";
>---------------------------------------------
Ben
------------------------------
Date: Mon, 13 Jan 2003 23:48:13 +0100
From: "Harald H.-J. Bongartz" <bongie@gmx.net>
Subject: Re: Can't get CGI script to work locally
Message-Id: <10974967.IuVUWay8up@nyoga.dubu.de>
Daniel Murphy wrote:
> I'm trying to get the following trivial code to work on my Win95
> machine with IE 5.50, but I can't get the browser to display anything.
What webserver are you using? Does it understand SSI?
I don't think you have a Perl problem here.
Ciao,
Harald
--
Harald H.-J. Bongartz <bongie@gmx.net>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
"Perl should only be studied as a second language. A good first
language would be English." - Larry Wall in [comp.lang.perl.misc]
------------------------------
Date: 13 Jan 2003 11:50:35 -0800
From: dan@tobias.name (Daniel R. Tobias)
Subject: Re: CGI - HTML Generation problems with images - scripts etc
Message-Id: <aab17256.0301131150.319ffb38@posting.google.com>
00056312@brookes.ac.uk (Stephen Adam) wrote in message news:<945bf980.0301120957.21dd3094@posting.google.com>...
> #This now works!
> <img src="C:\Program Files\sambar41\cgi-bin\sketchies.gif" alt="HOME
> PAGE HEADER">
Yuck... that's not even a valid URI. The correct syntax for accessing
files on your local system (bearing in mind that this won't work on
anybody else's system!) is:
file://C|/Program%20Files/sambar41/cgi-bin/sketchies.gif
Note the use of the "file:" URI scheme, the replacement of
system-specific backslashes with forward slashes (as required by
generic URI syntax), the replacement of the drive-letter colon with an
upright bar to prevent confusion with scheme separators, and the
encoding of the space as %20.
Even when accessing local files, it's a good idea to use valid URI
syntax, to ensure that it works on any user agent you might use on
your system. (I don't think Mozilla supports "C:\...." paths, for
instance.)
--
Dan
------------------------------
Date: 13 Jan 2003 13:22:35 -0800
From: johnbrantner1@hotmail.com (John)
Subject: CGI output displayed as text in Navigator
Message-Id: <fbb3da39.0301131322.4ed62d6c@posting.google.com>
Hello Perl gurus. Please direct me to a better group if you feel this
is not the appropriate place for this question.
On this page:
http://www.miraclemateusa.com/Buy-Miracle-Mate-Filter-Bags.htm
I have a simple form which points to a PERL script here:
http://www.miraclemateusa.com/cgi-bin/ordersupplies1.cgi
In IE, the output works exactly as I wanted, but in NN, the output is
displayed in the browser window as text:
<html>
<head>
<title>Miracle Mate USA, Inc. -- Enter Billing and Shipping
Information</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var
etc, etc...
Can anyone tell me why it is displayed as text in NN, but as a web
page in IE, and what change I can make in the code to fix this problem
for users?
Thanks in advance for your help!
Sincerely,
John B.
------------------------------
Date: 13 Jan 2003 13:41:18 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: CGI output displayed as text in Navigator
Message-Id: <3e23327e@news.victoria.tc.ca>
John (johnbrantner1@hotmail.com) wrote:
: Hello Perl gurus. Please direct me to a better group if you feel this
: is not the appropriate place for this question.
: On this page:
: http://www.miraclemateusa.com/Buy-Miracle-Mate-Filter-Bags.htm
: I have a simple form which points to a PERL script here:
: http://www.miraclemateusa.com/cgi-bin/ordersupplies1.cgi
: In IE, the output works exactly as I wanted, but in NN, the output is
: displayed in the browser window as text:
: <html>
: <head>
: <title>Miracle Mate USA, Inc. -- Enter Billing and Shipping
: Information</title>
: <meta http-equiv="Content-Type" content="text/html;
: charset=iso-8859-1">
: <script language="JavaScript">
: <!--
: function MM_swapImgRestore() { //v3.0
: var
: etc, etc...
: Can anyone tell me why it is displayed as text in NN, but as a web
: page in IE, and what change I can make in the code to fix this problem
: for users?
: Thanks in advance for your help!
: Sincerely,
: John B.
(Is this a faq?)
Can't say why without seeing the source code of the cgi script.
However, I would guess that the cgi script does not send the correct
content-type header. If using CGI.pm, then I think the basic html headers
can be sent most easily by
use CGI qw( :standard );
print header;
though read `perldoc CGI' to be sure.
------------------------------
Date: 13 Jan 2003 21:46:15 GMT
From: "Paul A. Rubin" <rubin@msu.edu>
Subject: Re: CGI output displayed as text in Navigator
Message-Id: <Xns9302AA9A134F6quantoid@35.8.2.20>
[posted and mailed]
johnbrantner1@hotmail.com (John) wrote in
news:fbb3da39.0301131322.4ed62d6c@posting.google.com:
> Hello Perl gurus. Please direct me to a better group if you feel this
> is not the appropriate place for this question.
>
> On this page:
> http://www.miraclemateusa.com/Buy-Miracle-Mate-Filter-Bags.htm
> I have a simple form which points to a PERL script here:
> http://www.miraclemateusa.com/cgi-bin/ordersupplies1.cgi
>
> In IE, the output works exactly as I wanted, but in NN, the output is
> displayed in the browser window as text:
>
> <html>
> <head>
> <title>Miracle Mate USA, Inc. -- Enter Billing and Shipping
> Information</title>
> <meta http-equiv="Content-Type" content="text/html;
> charset=iso-8859-1">
> <script language="JavaScript">
> <!--
> function MM_swapImgRestore() { //v3.0
> var
> etc, etc...
>
> Can anyone tell me why it is displayed as text in NN, but as a web
> page in IE, and what change I can make in the code to fix this problem
> for users?
>
> Thanks in advance for your help!
>
> Sincerely,
>
> John B.
>
Most likely culprit: Mozilla reports the MIME type as text/plain. Does
your CGI script write a header prior to the start of the HTML? The
output should look something like:
Content-type: text/html
<html>
...
Note the blank line between the header and the <html> tag (critical!).
If you don't declare the MIME type, then either your server defaults it
to plain text or NN (and Mozilla) use the .cgi extension to guess text.
I suspect it's the server. IE may see the <html> tag and override the
MIME type. (I'm guessing there. The only thing I know for sure about IE
and NN is that they really, really hate to display any given page the
same way.)
One other possible culprit: Your HTML is defective. You have a MAP tag
in no-man's land between </body> and </html>. IE seems to be a bit more
resilient than NN in compensating for incorrect HTML. It should be moved
inside the body of the page.
-- Paul
*************************************************************************
Paul A. Rubin Phone: (517) 432-3509
Department of Management Fax: (517) 432-1111
The Eli Broad Graduate School of Management E-mail: rubin@msu.edu
Michigan State University http://www.msu.edu/~rubin/
East Lansing, MI 48824-1122 (USA)
*************************************************************************
Mathematicians are like Frenchmen: whenever you say something to them,
they translate it into their own language, and at once it is something
entirely different. J. W. v. GOETHE
------------------------------
Date: Mon, 13 Jan 2003 21:54:13 +0000 (UTC)
From: mauzo@mimosa.csv.warwick.ac.uk (Ben Morrow)
Subject: Re: CGI output displayed as text in Navigator
Message-Id: <avvci5$2t3$1@wisteria.csv.warwick.ac.uk>
johnbrantner1@hotmail.com (John) wrote:
>Hello Perl gurus. Please direct me to a better group if you feel this
>is not the appropriate place for this question.
>
>On this page:
>http://www.miraclemateusa.com/Buy-Miracle-Mate-Filter-Bags.htm
>I have a simple form which points to a PERL script here:
>http://www.miraclemateusa.com/cgi-bin/ordersupplies1.cgi
>
>In IE, the output works exactly as I wanted, but in NN, the output is
>displayed in the browser window as text:
>
<snip>
>
>Can anyone tell me why it is displayed as text in NN, but as a web
>page in IE, and what change I can make in the code to fix this problem
>for users?
I would suspect the problem is that you are not serving the correct
content-type. I tried to check what headerrs your server was giving, but after
the first time (when I missed them) I got 'Connection refused'...
What is the first thing your script outputs?
(BTW, you probably ought to know this is a CGI rather than a Perl question...)
Ben
------------------------------
Date: Mon, 13 Jan 2003 22:55:48 +0100
From: "Harald H.-J. Bongartz" <bongie@gmx.net>
Subject: Re: CGI output displayed as text in Navigator
Message-Id: <9929822.qY2f7KrHkA@nyoga.dubu.de>
John wrote:
> http://www.miraclemateusa.com/cgi-bin/ordersupplies1.cgi
>
> In IE, the output works exactly as I wanted, but in NN, the output is
> displayed in the browser window as text:
% wget -s -O -
'http://www.miraclemateusa.com/cgi-bin/ordersupplies1.cgi'
[...]
HTTP/1.1 200 OK
Date: Mon, 13 Jan 2003 21:45:33 GMT
Server: Apache/1.3.26 (Unix) ApacheJServ/1.1.2 FrontPage/4.0.4.3
Connection: close
Content-Type: text/plain
Your script claims to deliver plain text, so any reasonable browser
should display it like that. (I think IE is the only browser to ignore
content-type headers and inspect the contents, if you want it or not.)
> <meta http-equiv="Content-Type" content="text/html;
> charset=iso-8859-1">
That's too late. The browser already got a content-type.
Ciao,
Harald
PS: Random signature, like always, I swear.
--
Harald H.-J. Bongartz <bongie@gmx.net>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
That's our advantage at Microsoft; we set the standards and we can
change them. -- Karen Hargrove, Microsoft, Feb 1993
------------------------------
Date: 13 Jan 2003 13:52:59 -0800
From: mike_solomon@lineone.net (Mike Solomon)
Subject: Creating PDF files that include images
Message-Id: <56568be5.0301131352.23cb58f3@posting.google.com>
I nead to create PDF files using Perl
I have tried PDF::create which works but I can't include images using it.
Does anyone know how to do this
Any help would be much appreciated.
Regards
Mike Solomon
------------------------------
Date: Mon, 13 Jan 2003 14:15:09 -0600
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: FULL VERSION: Hi all gurus. What is wrong in my script?
Message-Id: <3E231E4D.60702@mail.uca.edu>
Tad McClellan wrote:
> Cameron Dorey <camerond@mail.uca.edu> wrote:
>
>>juha wrote:
>>
>
>>> if ($size1 = $size2 ) {
>>>
>
>>You obviously did not use the -w switch or use warnings; (not sure of
>>capitalization here) and use strict; in your script. If you had, Perl
>>would have told you automatically.
>>
>
>
> If you are referring to the mistake in the line of code above,
> then warnings won't help.
>
> That statement does not generate a warning.
Harrumph! Then, if you would, why does it not produce a warning when
if ($size1 = 0) {
will give you:
Found = in conditional, should be == at untitled1.pl line x.
This ain't fair! I thought I finally understood something.
Cameron
--
Cameron Dorey
Associate Professor of Chemistry
University of Central Arkansas
Phone: 501-450-5938
camerond@mail.uca.edu
------------------------------
Date: Mon, 13 Jan 2003 15:09:39 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: FULL VERSION: Hi all gurus. What is wrong in my script?
Message-Id: <slrnb26aoj.46m.tadmc@magna.augustmail.com>
Cameron Dorey <camerond@mail.uca.edu> wrote:
> Tad McClellan wrote:
>> Cameron Dorey <camerond@mail.uca.edu> wrote:
>>>juha wrote:
>>>
>>
>>>> if ($size1 = $size2 ) {
>>>>
>>
>>>You obviously did not use the -w switch or use warnings;
>> If you are referring to the mistake in the line of code above,
>> then warnings won't help.
>>
>> That statement does not generate a warning.
>
>
> Harrumph!
I said something similar when I discovered it. :-)
> Then, if you would, why does it not produce a warning when
Because both sides are variable, which could be normal and expected.
In the code above it could be a convoluted way of testing if
$size2 is false, while also remembering the false value in $size1.
(the value of an assignment is the value that was assigned)
> if ($size1 = 0) {
>
> will give you:
>
> Found = in conditional, should be == at untitled1.pl line x.
Testing agains a constant _does_ look suspicious, so now
it _can_ (unambiguously) issue a warning.
We know that the above will always be false, even without
knowing anything about $size1's value (that is going to
get overwritten anyway).
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 13 Jan 2003 12:45:28 -0800
From: Andrew.Allaire@na.teleatlas.com (Andrew Allaire)
Subject: Re: How does one determine why perl prog runs so slow????
Message-Id: <6bdb91de.0301131245.58dbb0b@posting.google.com>
R.Mariotti@FinancialDataCorp.com (Bob Mariotti) wrote in message news:<3e1f9aaf.7348417@news.cshore.com>...
> Honestly! I HAVE searched this group, other perl sites, perlfaqs, etc
> and I cannot find anything that actually covers this topic. It IS
> perl so I'm posting in the perl group.
>
> I have a perl program that has been in production for a couple of
> years. It was originally developed under perl 5.005 running under the
> IBM AIX version 4.2.1 OS. Performance was blazingly fast.
>
> Some months ago we upgraded our servers OS to IBM AIX version 5.1
> which comes with perl 5.6 but I could NOT get DBI/DBD installed to
> link to MySQL.
>
> Finally I downloaded the source for Perl 5.8 and compiled it cleanly
> using gcc which I obtained from the Bull Freeware site.
>
> Upon completion the perl program(s) along with MySQL functioned fine.
> Great news! I though.
>
> Here's the scope of the application:
>
> We builld a database (MySQL type MyIsam) about 30 MB in size.
>
> We then have a large sequential file (3 million records) which our
> program reads. It does a pattern match on each line and upon the
> detection of certain lines it randomly accesses the MySQL database to
> obtain some info.
>
> It them conditionally outputs a small sequential file.
>
> On the prior OS this process would run to completion in less than one
> hour.
>
> Now - on the new OS version with Perl 5.8 the same program using the
> same data files and database took over FORTY EIGHT HOURS to complete.
>
> I ruled our a MySQL issue because if I comment out the MySQL access
> the run time is still incredibly slow.
>
> So, here's my question for the perl guru's that I could not find in
> the faqs or other resources:
>
> How does one go about determining what may be the cause of this
> unacceptable performance? I researched the module Benchmark but that
> only measures time. Where should one start? Is this an issue that
> others have experienced (I'm sure) and what was done to overcome it?
>
> BTW - the performance on our non-perl applications still rockets along
> so I don't think its the system/OS itself.
>
> I will be eagerly awaiting any and all suggestions.
>
> Bob
I think simpler is better. I usually just print out the number of
seconds between each step by using something like...
$CURR_TIME = time ;
my $delta = $CURR_TIME - $LAST_TIME ;
print LOG ("Step whatever took $delta seconds\n") ;
$LAST_TIME = $CURR_TIME ;
------------------------------
Date: Tue, 14 Jan 2003 03:33:53 +0800
From: "oooooops" <oooooops@163.com>
Subject: Re: how to redirect STDIN to such place like /dev/null ??
Message-Id: <avv4hr$19b8$1@mail.cn99.com>
hehe, I have already found the way,
I just want to find the blank line,
I got wrong, the key is
m/^$/
why I need to close the STDIN? I want to filt
out the header of a mail, so you know if I read
whole file of a mail with a tens magabytes attachment
to memory..... so terrible.
hehe, so, I think, I close the STDIN
as soon as I find the blank line.
so that ......aha~, actually, I do not know
how to redirect the pipe and push the big
body of mail to null in perl.
Ooops
<pauli@johannes-pauli.de> wrote in message
news:3E22F0CE.AF254227@johannes-pauli.de...
| oooooops wrote:
|
| > I set up a script for catching output of a pipe
| > from aother program as following.
| > but I can not close the STDIN
|
| Why do you want to close STDIN anyway?
|
| >
| > or just redirect else behind double "\n"
| > input. if I run it with
| > $perl to_file.pl
| > I have to type three time enter to end
| > the script, but there is only two "\n"
| > in the file catched. I am confused with it.
|
| Me too, because it takes two "\n" to finish the programm on my linux
| box.
|
| >
| >
| > could you give me some advice ??
| >
| > Thanks!!
| >
| > [test@mail test]$ less to_file.pl
| > #!/usr/bin/perl -w
| >
| > use strict;
| >
| > my $i;
| > open (DEST, ">>/home/test/testfile.dat")||die "$!";
| > $i=0;
| > OUTER: while (<STDIN>){
| > if ($_ eq "\n" && $i==1){
| > # close STDIN;
| > last OUTER;
| > }elsif($_ eq "\n" && $i==0){
| > $i=1;
| > }else{
| > $i=0;
| > }
| > print DEST $_;
| > }
| > close (DEST);
|
| --
|
| PI4: Wir forschen gern!
| \\|//
| (. .)
| ------------------------------oOOo-(_)-oOOo---------------------
|
| Johannes Pauli
| Physikalisches Institut IV
| Erwin-Rommel-Str. 1
| 91058 Erlangen
| Germany
|
| -o) | Tel. : ++49-(0)9131-852-7153
| /\\ | Web : http://www.johannes-pauli.de
| _\_v | email : pauli@johannes-pauli.de
|
|
|
------------------------------
Date: 13 Jan 2003 19:49:32 GMT
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Subject: Re: how to redirect STDIN to such place like /dev/null ??
Message-Id: <avv58c$708$1@canopus.cc.umanitoba.ca>
In article <avv4hr$19b8$1@mail.cn99.com>, oooooops <oooooops@163.com> wrote:
:why I need to close the STDIN? I want to filt
:out the header of a mail, so you know if I read
:whole file of a mail with a tens magabytes attachment
:to memory..... so terrible.
:hehe, so, I think, I close the STDIN
:as soon as I find the blank line.
:so that ......aha~, actually, I do not know
:how to redirect the pipe and push the big
:body of mail to null in perl.
Urrr, why not simply not read any further into the file? There's no
rule that you have to read to the end of a file or else close the file
promptly. You can just leave the file open and untouched until you
are ready to close it.
--
And the wind keeps blowing the angel / Backwards into the future /
And this wind, this wind / Is called / Progress.
-- Laurie Anderson
------------------------------
Date: 13 Jan 2003 21:07:43 +0100
From: Jan Korger <QSPDVOFMGTUJ@spammotel.com>
Subject: Re: how to redirect STDIN to such place like /dev/null
Message-Id: <87smvwyfsg.fsf_-_@jan.korger>
stop crossposting please.
The appropriate forum for this is
comp.lang.perl.misc
Period. And none of the others. It's so obvious, any poster should know this.
------------------------------
Date: 13 Jan 2003 22:03:05 GMT
From: "Paul A. Rubin" <rubin@msu.edu>
Subject: Re: installing modules under Cygwin -- never mind!
Message-Id: <Xns9302AD7503Cquantoid@35.8.2.20>
Found the answer on the web 10 minutes after posting the question (of
course). This after an hour or so of fruitless searching *prior* to
posting the question.
Turns out it's something goofy with permissions. When I looked at
Windows XP's security permissions for perl5.6.1.exe (right click on icon,
properties, security tab), it showed full permissions for my user account
and the SYSTEM account and read/execute for other users. But when I
tried ls -l from a Cygwin prompt, it showed rwx for the owner but no
permissions for others. A similar problem occurred for pod2man. So I
whacked the entire /bin directory with chmod 755 *, and things seem to be
working a bit better now. (If you're cringing about the security
implications of that, take heart -- it's a single user system. The only
users with logon privileges are admins, and I have it firewalled.)
I'm not sure why Windoze and Cygwin were showing different permissions
for the same files. Then again, we could have truncated that sentence
after "why".
-- Paul
"Paul A. Rubin" <rubin@msu.edu> wrote in
news:Xns9302A81D4B37quantoid@35.8.2.20:
> Hi,
>
> I'm having trouble installing modules under Cygwin (Perl
> 5.6.1)/Windows XP.
>
> First problem: something (MakeMaker?) can't find perl. Typical
> output (installing Test::Harness):
>
> $ perl Makefile.PL
> Test::Harness likes to have Devel::CoreStack, but doesn't require it.
> Unable to find a perl 5 (by these names: perl miniperl perl perl5
> perl5.6.1, in these dirs: /usr/local/bin /usr/bin /bin /usr/bin ...)
>
> Now /bin contains perl.exe and perl5.6.1.exe (/usr/bin is empty and
> linked to /bin). I think something (perl? MakeMaker?) is being a
> trifle too literal with the file name: adding a symbolic link (ln
> perl5.6.1.exe perl5.6.1) doesn't help, but if I make a copy of
> perl5.6.1.exe in the /bin directory and rename it perl5.6.1 (drop the
> .exe extension), then I get past that message. Seems like a rather
> clunky work-around.
>
> Second problem: something (MakeMaker?) can't find pod2man. New
> output (after the fix above):
>
> $ perl Makefile.PL
> Test::Harness likes to have Devel::CoreStack, but doesn't require it.
>
> Warning: I could not locate your pod2man program. Please make sure,
> your pod2man program is in your PATH before you execute
> 'make'
>
> Writing Makefile for Test::Harness
>
> Once again, pod2man is in /bin, this time with no extension:
>
> $ echo $PATH
> /usr/local/bin:/usr/bin:/bin:/usr/bin:...
>
> $ type pod2man
> pod2man is /usr/bin/pod2man
>
> $ ls -l /bin/pod2man
> -rwx------+ 1 65535 65535 17575 Aug 21 2001 /bin/pod2man
>
> I have no idea what to do about this one. TIA for any suggestions.
>
> -- Paul
------------------------------
Date: Mon, 13 Jan 2003 14:50:30 -0500
From: Jim Agnew <jpagnew@vcu.edu>
Subject: Re: My, our, etc.
Message-Id: <3E231886.D6547944@vcu.edu>
Richard S Beckett wrote:
>
> "Jim Agnew" <jpagnew@vcu.edu> wrote in message
> news:3E22D793.DD683DD9@vcu.edu...
> > Thank you guys, for this very, very timely article. it helped greatly,
> > and would like to ack you all.
> >
> > jim
> >
> > Jay Tilton wrote:
> > >
> > > "Richard S Beckett" <spikey-wan@bigfoot.com> wrote:
> > >
> > > : In fact, as
> > > : long as they're not duplicated, what's wrong with our anyway, just to
> be on
> > > : the safe side?
> > >
> > > The "as long as they're not duplicated" part is a big issue.
> > > _The_ issue, in fact.
> > >
> > > Writing a program while manually ensuring that variables do not get
> > > clobbered is hard.
> > >
> > > Writing a program (or portion thereof) where variables have guaranteed
> > > privacy and cannot get clobbered is easy.
> > >
> > > Defensive programming is where it's at, cat.
>
> Oh dear!! I've just seen this post. Unfortunately I haven't seen the post it
> referrs to.
>
> A quick brows on google reveals that there are far more posts in this thread
> than my news server seems to have, so if I came across as really stupid [1]
> or rude to anyone, I apologise. I'm just nipping off to google to read _all_
> the posts before I make an even bigger pillock of myself than necessary ;-)
>
> Thanks for your replies [2], and sorry.
>
> R.
>
> [1] I'm only _quite_ stupid ;-)
> [2] Even though I've yet to read them.
no, you're NOT stupid... We just have one big awfull fat server to
gobble it all up...
------------------------------
Date: 13 Jan 2003 21:31:34 GMT
From: "Paul A. Rubin" <rubin@msu.edu>
Subject: Newbie Q: installing modules under Cygwin
Message-Id: <Xns9302A81D4B37quantoid@35.8.2.20>
Hi,
I'm having trouble installing modules under Cygwin (Perl 5.6.1)/Windows
XP.
First problem: something (MakeMaker?) can't find perl. Typical output
(installing Test::Harness):
$ perl Makefile.PL
Test::Harness likes to have Devel::CoreStack, but doesn't require it.
Unable to find a perl 5 (by these names: perl miniperl perl perl5
perl5.6.1, in these dirs: /usr/local/bin /usr/bin /bin /usr/bin ...)
Now /bin contains perl.exe and perl5.6.1.exe (/usr/bin is empty and
linked to /bin). I think something (perl? MakeMaker?) is being a trifle
too literal with the file name: adding a symbolic link (ln perl5.6.1.exe
perl5.6.1) doesn't help, but if I make a copy of perl5.6.1.exe in the
/bin directory and rename it perl5.6.1 (drop the .exe extension), then I
get past that message. Seems like a rather clunky work-around.
Second problem: something (MakeMaker?) can't find pod2man. New output
(after the fix above):
$ perl Makefile.PL
Test::Harness likes to have Devel::CoreStack, but doesn't require it.
Warning: I could not locate your pod2man program. Please make sure,
your pod2man program is in your PATH before you execute 'make'
Writing Makefile for Test::Harness
Once again, pod2man is in /bin, this time with no extension:
$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/bin:...
$ type pod2man
pod2man is /usr/bin/pod2man
$ ls -l /bin/pod2man
-rwx------+ 1 65535 65535 17575 Aug 21 2001 /bin/pod2man
I have no idea what to do about this one. TIA for any suggestions.
-- Paul
*************************************************************************
Paul A. Rubin Phone: (517) 432-3509
Department of Management Fax: (517) 432-1111
The Eli Broad Graduate School of Management E-mail: rubin@msu.edu
Michigan State University http://www.msu.edu/~rubin/
East Lansing, MI 48824-1122 (USA)
*************************************************************************
Mathematicians are like Frenchmen: whenever you say something to them,
they translate it into their own language, and at once it is something
entirely different. J. W. v. GOETHE
------------------------------
Date: Mon, 13 Jan 2003 22:46:42 GMT
From: bugs.bunny@carrot.inc (Bugs Bunny)
Subject: Perl command line processing, Windows/dos style ?
Message-Id: <3e2341c1.13839359@news.hccnet.nl>
Hi,
I'm trying to get a perl script to behave more like other windows
command line tools, and it is driving me NUTS that I cannot get perl
to simply give me the command line as-is.
As is normal under unix, perl expands the command line automatically.
For instance, when invoking 'scipt.pl' with as option '*', you'll
get a list of all files in the current directory as arguments.
So I already got used to enclose the arguments with double quotes to
prevent expansion. Not too bad, because if you want to pass paths with
embedded spaces, you have to enclose these with double quotes anyway
to keep the parts together.
But you forget you're dealing with a perl script, and forget the
double quotes, well, anything can happen, as your script gets
arguments that he does not expect.
So you try to be carefull, and use double quotes. But then you try to
pass the argument C:\ as an argument enclosed by double quotes, so as
"C:\". Doesn't work. The sequence \" is replaced by single quote, and
the argument is concatenated with the next argument: the \" is a way
to include a double quote in a double quoted String. AAARRRGGGGHHHH
I JUST WANT THE COMMANDLINE THE WAY THE USER ENTERS IT!!!!
Anbody a good suggestion?
Thanks !!!!!
I use (Active)Perl release 5.6.1 under Windows XP.
------------------------------
Date: Mon, 13 Jan 2003 13:54:35 -0800
From: "Brian Helterline" <brian_helterline@hp.com>
Subject: Re: Regenerating Activeperl html documentation
Message-Id: <avvcjb$pk0$1@hpcvsgen.cv.hp.com>
"Stuart Moore" <stjm2@cam.ac.uk> wrote in message
news:avum3n$2fg$1@pegasus.csx.cam.ac.uk...
> Activestate perl comes with some rather nicely presented html
documentation,
> but there seems to be no way to get it to regenerate it other than
partially
> uninstall then reinstall. Anyone got any suggestions? Google gave nothing.
>
> Stuart
>
here's what I've done after manually installing modules from CPAN:
Run doc.pl from you perl\bin directory. It basically runs pod2html with
settings that work for ActiveState sytle sheet and then rebuilds the table
of contents. If my memory
serves me, you may have to more the resulting html files a bit. I never
really polished
up this script but you will get the idea.
#!perl -w
#convert pod to html to look like standard ActiveState html and install it.
#Currently is accepts POD from ARGV and writes html to the default html
directory
# move the output to the appropriate html directory and then
# regenerate ActiveState TOC (TOC.pl)
# Things to Do
# 1. use Config module to pull out html output directory automatically
(Config{installhtmldir}
# 2. figure out how to set podroot, podpath, htmlroot, htmldir to correctly
handle cross-references
# and how all the relative paths work together
# 3. Figure out how to properly put docs in html/lib/... or html/site/lib..
based on location of .pm file
# idea: directory to .pm file can be used to create html directory.
use Pod::Html;
use Config;
use File::Basename;
use File::Spec qw( :ALL );
#my $cdir = File::Spec->curdir;
my $prefix = $Config{prefix};
my ($file, $infile, $htmlfile);
foreach ( @ARGV ) {
$infile = File::Spec->rel2abs( $_ );
$file = $infile;
if ( $file =~ s/^\Q$prefix\E//oi ) {
$htmlfile = $prefix . "\\html" . $file;
$htmlfile =~ s/\.[^.]*$/\.html/;
pod2html( "--header",
"--css=../../../Active.css",
"--norecurse",
"--infile=$infile",
"--outfile=$htmlfile",
"--verbose"
);
}
}
use ActivePerl::DocTools;
print "Building TOC....";
ActivePerl::DocTools::WriteTOC();
print "done.\n\n";
------------------------------
Date: Mon, 13 Jan 2003 16:14:27 -0500
From: Marshall Dudley <mdudley@execonn.com>
Subject: Re: sleep aborts script
Message-Id: <3E232C33.642C7BB8@execonn.com>
Brian McCauley wrote:
> Marshall Dudley <mdudley@execonn.com> writes:
>
> > I am having a problem where a sleep will abort the script and am unable
> > to figure out why. The code suppose to send an email out, then wait a
> > minute and send another email out. The browser connection is closed
> > before the sleep so that the browser does not "hang" for that time.
>
> "Browser"? Is this a stealth-CGI question? If so you presumably mean
> "HTTP server" not "browser".
There is a connection from the browser to the http server then from the http
server to perl. They both get broken, like hanging up a phone. I normally
say I hung up on the party that called, not the phone company, since the
phone company is the means by which the connection is made.
>
>
> > close stdout;
> > sleep 10; #pause for 10 seconds
> > if (open(MAIL,"|\/usr\/sbin\/sendmail -t")) {
>
> > If I comment out the sleep the second email gets sent, but if the sleep
> > is in the code as above, the second email never gets sent even when the
> > sleep is dropped to 10 seconds.
> >
> > Anyone have any ideas why the script aborts on the sleep?
>
> I suspect what actually happens is caused to abort by some external
> influence e.g. SIGPIPE a short time after you close STDOUT. If you
> remove the sleep then you manage to send the mail before this happens.
>
> I doubt that what you are observing has little to do with your
> choice of Perl as a language in which to implement CGI scripts.
>
> I suggest you fork your task completely into the background (see FAQ).
That worked.
Thanks,
Marshall
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 4396
***************************************