[9409] in Perl-Users-Digest
Perl-Users Digest, Issue: 3004 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 27 17:07:13 1998
Date: Sat, 27 Jun 98 14:00:44 -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 Sat, 27 Jun 1998 Volume: 8 Number: 3004
Today's topics:
Re: [-Mail2Html-] (Snowhare)
Re: [-Mail2Html-] (Jonathan Stowe)
Re: ANNOUNCEMENT: clpa doesn't accept perl announcement <tchrist@mox.perl.com>
Any idea about ...... <delta@netpage.tm.fr>
Re: CGI Question In Regards To & Char (Jonathan Stowe)
Re: Download file to browser via application/x-compress <quednauf@nortel.co.uk>
Re: Exit status from system() not what I expected (and (Brandon S. Allbery KF8NH)
expanding scalars in "opened" file(handles)... <ptrainor@bbn.com>
Re: expanding scalars in "opened" file(handles)... <jdf@pobox.com>
expanding scalars that sit in included files: <ptrainor@bbn.com>
Re: expanding scalars that sit in included files: <tchrist@mox.perl.com>
Re: Flames.... (John Moreno)
Re: HTML pages with Perl (mikep)
Re: newbie Location: syntax help wanted <jthscifi@yahoo.com>
Re: newbie Location: syntax help wanted (Jonathan Stowe)
Parsing a list of names and assigning each to an arry? <mzschoch@bc.sympatico.ca>
Re: Parsing a list of names and assigning each to an ar <tchrist@mox.perl.com>
Perl DB question version upgrade from 5.002 to 5.004_4 Marvin Malkowski Jr.
Re: Subroutine Variables (mikep)
Re: Subroutine Variables <tchrist@mox.perl.com>
Re: Uploading perl scripts with a perl script. ttwallace@my-dejanews.com
Re: Uploading perl scripts with a perl script. ttwallace@my-dejanews.com
Re: Uploading perl scripts with a perl script. (Jeremy D. Zawodny)
Re: Uploading perl scripts with a perl script. (Jonathan Stowe)
What is a Terminator "EOM"??? <webmaster@earthstations.com>
Re: What is a Terminator "EOM"??? (Michael Budash)
Re: What is a Terminator "EOM"??? <quednauf@nortel.co.uk>
Re: What is a Terminator "EOM"??? (Ronald J Kimball)
Re: What is a Terminator "EOM"??? <jdf@pobox.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 27 Jun 1998 17:43:14 GMT
From: snowhare@devilbunnies.org (Snowhare)
Subject: Re: [-Mail2Html-]
Message-Id: <6n3avi$nfq$1@supernews.com>
Nothing above this line is part of the signed message.
In article <359508d2.10728719@news.btinternet.com>,
Jonathan Stowe <Gellyfish@btinternet.com> wrote:
>On Sat, 27 Jun 1998 17:16:04 +0300, Margus Kohv wrote :
>
>>Hi!
>>I have a problem.
>
>Yep, your browser has sent this post with all this HTML crud round and
>worse it didnt even have the decency to announce the fact with a
>"Content-type" header field. Thats *very* broken.
[snip]
Look again at the headers. It clearly declared itself as text/html.
Interestingly, TRN 4.0 cleanly stripped the HTML tags - it just looked
like normal text on my screen until I used the 'v' key. Something
to be said for that.
Benjamin Franz
Version: 2.6.2
iQCVAwUBNZUz5+jpikN3V52xAQG8KgP/Xkow1eocnNZtUBKOxXL46GguJUscIiZY
Im11LPjTAZBejLSbFJNBvRFDfS9OGZ/CAPhxkXZ25jKIzYuCkp1oVhh8G0XIbCdR
1QZeaItYN37plpI5rVqjjCzLi/sAJC8EcjOdyZfZsVCI8LPdsvseOxf5cxYWUzGK
cN3gfxVAfm4=
=o4uE
-----END PGP SIGNATURE-----
------------------------------
Date: Sat, 27 Jun 1998 20:25:21 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: [-Mail2Html-]
Message-Id: <359547ee.26766600@news.btinternet.com>
On 27 Jun 1998 17:43:14 GMT, Snowhare wrote :
>
>
>Nothing above this line is part of the signed message.
>
I dunno about this. After all *my* heap-of-crap newsreader wouldnt
care whether it was forged or not.
>In article <359508d2.10728719@news.btinternet.com>,
>Jonathan Stowe <Gellyfish@btinternet.com> wrote:
>>On Sat, 27 Jun 1998 17:16:04 +0300, Margus Kohv wrote :
>>
>>>Hi!
>>>I have a problem.
>>
>>Yep, your browser has sent this post with all this HTML crud round and
>>worse it didnt even have the decency to announce the fact with a
>>"Content-type" header field. Thats *very* broken.
>
>[snip]
>
>Look again at the headers. It clearly declared itself as text/html.
Jonathan : Give me a "D"
Crowd : "Deeee"
Jonathan : Give me an apostrophe
Crowd : Apostropheee
Jonathan : Give me an "O"
Crowd : "O"
Jonathan : Give me an "H"
Crowd : Aitch!
Jonathan : And what have we got ?
Crowd : D'oh!
>Interestingly, TRN 4.0 cleanly stripped the HTML tags - it just looked
>like normal text on my screen until I used the 'v' key. Something
>to be said for that.
Lovely. A bit like ELVIS then. Unfortunately I (and I would suggest
most people) dont get the choice.
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 27 Jun 1998 19:18:09 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: ANNOUNCEMENT: clpa doesn't accept perl announcements!
Message-Id: <6n3ghh$sp6$1@csnews.cs.colorado.edu>
I tried to be nice, but it failed. Randal is derelict in his duties,
plain and simple. The system is broken, but easily fixed. But
he refuses, letting perfectly fine postings languish for more
than two solid weeks before he mindlessly rejects them. This is
unacceptable in time-sensitive material, because they're dead by
the time they're posted.
Not merely has every Perl user queried wanted to see the censored
announcements posted to the Perl announce group, even some of Randal's
fellow moderators have publicly denounced this flagrant miscarriage of
justice and questioned its very legality vis-a-vis the group charter.
We need either a Perl announcement group that actually contains Perl
announcements, or else we need a new moderator. It can be trivially
fixed, right now. We don't need a committee. We just need someone doing
their job. Of all people, Randal should know how vicious and unjust a
blind adherence to a dubious misreading of the letter of the law can be.
Swords cut both ways.
Send Randal mail. Or volunteer to be the new moderator. :-)
--tom
--
"Lasciate ogni speranza, voi ch'entrate!"
------------------------------
Date: Sat, 27 Jun 1998 19:30:37 +0200
From: "delta" <delta@netpage.tm.fr>
Subject: Any idea about ......
Message-Id: <6n39qi$emp$1@front5.grolier.fr>
Hi,
Look at the following script lines :
<td align="middle" bgcolor="#e1e1e1" colspan="2">
<font face="Book Antiqua" size="3" color="#00356A">
FIN
$cnt=0;
while (!(@info->[$cnt] =~ /---------------/))
@info->[$cnt] =~ s/\n/<BR>/g;
print @info->[$cnt];
$cnt++;
} for ($i=1;$i<=$cnt+1;$i++) {shift @info;}
print << "FIN";
</td>
These lines are "calling" a field, and this field is a image name. (this
field could be empty or full)
So I would like write somewhere my <img src=" FIELD ">
But if I put it before FIN et after "FIN" I retrieve my tag in my html page
generated by the script, and that is normal, so where should I write my <img
scr=" ....... "> to get this tag only if the field is full ?????
We try a lot of solutions but any of them was the good one
Thank's in advance for your help
TOM
delta@netpage.tm.fr
------------------------------
Date: Sat, 27 Jun 1998 20:25:28 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: CGI Question In Regards To & Char
Message-Id: <359551dd.29309408@news.btinternet.com>
On Sat, 27 Jun 1998 15:48:24 GMT, Ralph Freshour wrote :
>I have a perl cgi script that has been working for many months passing
>data from the browser to the unix server to write text data to disk -
>I recently discovered that if one of the characters in the text lines
>contains an & char, the cgi transfer truncates all of the data
>starting from the & char and everything else!!! In other words, I
>only get the data up to the & and not the rest of the data.
>
>What can I do to transfer the & char and not have this happen?
>
Aieee.
Of course this is *NOT A PERL THING* . The ampersand character has
special meaning in CGI terms being the character used to separate
parameters in the query string. I dont really want to go into this
but my thought is that a browser should translate/escape these
characters. You might get more sense out of a more CGI oriented NG
like comp.infosystems.www.authoring.cgi or preferably its FAQ.
If you use CGI.pm you might find yourself with an extra param() whose
name contains the missing data however.
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 27 Jun 1998 18:45:22 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: Download file to browser via application/x-compress
Message-Id: <35952FB2.BE406DA@nortel.co.uk>
RHooD wrote:
>
> Hi !
>
> I have a big problem !!!
>
> I have written a script who download a file from a remote server,
> but when i click in a browser on the href, in the savebox ,
> the name of the perlscript are standing !!!!
>
> how can i tell the browser that the filename is xxx.zip ?????
Hey RHooD!!!!!!!!!!!!!!!!
This is not a Perl problem !?!?!?!?!?
Too right!!!!!!
Have a more thorough look at your Webserver!!!!!!!!!
It might be its not exe'cute'ing your Perl script !!!!!!!!!!!!!
> please answer fast !!! THX
Was this fast enough ???????????????
--
____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________
------------------------------
Date: 25 Jun 1998 18:03:29 -0400
From: allbery@kf8nh.apk.net (Brandon S. Allbery KF8NH)
Subject: Re: Exit status from system() not what I expected (and other doc probs)
Message-Id: <6muhfh$uls$1@rushlight.kf8nh.apk.net>
Also sprach ced@bcstec.ca.boeing.com (Charles DeRykus) (<Ev14w2.9r0@news.boeing.com>):
+-----
| system launchs another shell apparently. I'm not sure
| why this happens in the case of yes though.
+--->8
He included a redirection, therefore /bin/sh was used to run it.
--
brandon s. allbery [os/2][linux][solaris][japh] allbery@kf8nh.apk.net
system administrator [WAY too many hats] allbery@ece.cmu.edu
electrical and computer engineering
carnegie mellon university (bsa@kf8nh is still valid.)
------------------------------
Date: Sat, 27 Jun 1998 13:28:22 -0400
From: Pat Trainor <ptrainor@bbn.com>
Subject: expanding scalars in "opened" file(handles)...
Message-Id: <Pine.LNX.3.95.980627131932.17153A-100000@aura>
(sorry about the test..)
Greetings!
a master script has defined:
$fred = "abc";
$file = "/path/to/some/file";
..later in that script:
######################################
$HANDLE = "$file";
open HANDLE ;# or die "Can't open $HANDLE : $!\n";
while (<HANDLE>) {
print;
} # end of while (<HANDLE>) ...
close (HANDLE);
######################################
All is well, but the file pointed to by $file has the scalar
"$fred" contained within it's text! ..as in..
(excerpt from file /path/to/some/file or.. $file):
[...]
blah, blah, blah, ...
fred is $fred
blah, blah, blah, ...
[...]
(end excerpt)
Query: How can the scalar $fred that sit _in_ $file be expanded to it's
assigned value in the program calling it as a file handle?
###############################################
instead of our script with the open() doing:
[...]
blah, blah, blah, ...
fred is abc <---=== desired
blah, blah, blah, ...
[...]
we get:
[...]
blah, blah, blah, ...
fred is $fred <---=== not desired
blah, blah, blah, ...
[...]
###############################################
Any takers?! :)
pat
:)
------------------------------
Date: 27 Jun 1998 15:49:40 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: Pat Trainor <ptrainor@bbn.com>
Subject: Re: expanding scalars in "opened" file(handles)...
Message-Id: <n2ay1sez.fsf@mailhost.panix.com>
Pat Trainor <ptrainor@bbn.com> writes:
> Query: How can the scalar $fred that sit _in_ $file be expanded to it's
> assigned value in the program calling it as a file handle?
This question is addressed in the "perlfaq4" document that comes with
perl. Look for the question "How can I expand variables in text
strings?".
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf/
------------------------------
Date: Sat, 27 Jun 1998 15:57:31 -0400
From: Pat Trainor <ptrainor@bbn.com>
Subject: expanding scalars that sit in included files:
Message-Id: <Pine.LNX.3.95.980627155052.18703B-100000@aura>
thanks to Alan Meyer I found a partial solution. If I already know all the
possible scalar names I can sort through every line of the included file
and search:
while (<HANDLE>) {
if (/(\$fred)/) {
print $` . $fred . $' ;
} else {
print;
}
} # end of while (<HANDLE>) ...
..obviously I could add more possibilities with elsif, but the
idea is that there might be a faster way to check all possibilities,
especially if there are a dozen or more possible scalars (more than one on
a single line, too) total.
There might be a way to globally expand scalars nested inside an
"open()"'d file.. mighten there?
pat
:)
Pat Trainor
------------------------------
Date: 27 Jun 1998 20:34:09 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: expanding scalars that sit in included files:
Message-Id: <6n3l01$6d3$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Pat Trainor <ptrainor@bbn.com> writes:
: There might be a way to globally expand scalars nested inside an
:"open()"'d file.. mighten there?
What does that mean? Do you mean you have a data file that
contains strings like "please place $varname in the bucket",
and you want the program to expand that value in the data?
Does this have any resemblance to the question "How can I expand variables
in text strings?" answered in perlfaq4?
--tom
--
"We stand on the shoulders of giants and kick
their ears whenever we feel like it." --Larry Wall
------------------------------
Date: Sat, 27 Jun 1998 19:47:08 GMT
From: phenix@interpath.com (John Moreno)
Subject: Re: Flames....
Message-Id: <1dbaa9a.1b3nzbn80mimjN@roxboro0-022.dyn.interpath.net>
<birgitt@my-dejanews.com> wrote:
> phenix@interpath.com (John Moreno) wrote:
> >
> > <birgitt@my-dejanews.com> wrote:
> >
> > > phenix@interpath.com (John Moreno) wrote:
> >
> > Hmn, I take the "painful" to mean all of the mean spirited response's
> > saying "That's in the faq idiot, besides you're stupid and give lousy
> > head" (not that I think they are like that, but he seems to).
>
> I have never seen one like that, so they *are* not like it and if they
> do *seem* like that it is mostly a matter of your own perception,
> of which one has some control over.
>
>
> > And I can't figure out why that would be painful - it right away points
> > out that there is something called a "faq" and that it has a whole bunch
> > of answers.
>
> It's you who interpreted that I consider this part being painful,
> I didn't say it.
Well, I was saying that was what I thought /Leslie Mikesell/ found
painful. Not yourself. I must not have expressed myself very well and
so apologize.
I can certainly understand what /you/ mean by "painful" and even agree.
--
John Moreno
------------------------------
Date: 27 Jun 1998 16:51:43 GMT
From: mikep@rt66.com (mikep)
Subject: Re: HTML pages with Perl
Message-Id: <6n37uv$74c$2@news.rt66.com>
In article <3593E5F9.3848F1DF@mail.which.net>
Jaap Prins <jaap.prins@mail.which.net> writes:
> Is it possible to produce an HTML page with a CGI-Perl programme
> using Perl 5.003(!)? If so, How?
As stated in another reply use the "print" primitive to output text.
The trick is that the first line out of your perl script must be
"Content-type: text/html\n\n" (note the two line breaks, don't forget
them) if your script is to be a standalone script (e.g. a standalone
"page"). If you're calling your script via an #exec or some other
server side include, then you need not print out that first bit of text
(e.g. an HTML page is already being processed by the HTTPD server).
===========================
Mike Powell
mikep@rt66.com
http://www.rt66.com/~mikep/
------------------------------
Date: Sat, 27 Jun 1998 21:17:13 +0300
From: "Jouni Honkala" <jthscifi@yahoo.com>
Subject: Re: newbie Location: syntax help wanted
Message-Id: <6n3ct5$na8$1@tron.sci.fi>
Skip Lawson kirjoitti viestissd <35918F92.DAE28821@sonic.net>...
>I believe you have to have two \n's
>print "Content-Type: text/html\n\n"; # HTTP Header Info
>
>the Skipinator
>
>Jouni Honkala wrote:
>> print "Content-Type: text/html\n"; # HTTP Header Info
Here the HTML headers continue. If they would end here, then we would
need two linefeeds to separate them from the text.
>> print "Location: myfile.html\n"; # \n means line feed
------------------------------
Date: Sat, 27 Jun 1998 20:25:27 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: newbie Location: syntax help wanted
Message-Id: <359550d1.29041923@news.btinternet.com>
On Sat, 27 Jun 1998 21:17:13 +0300, Jouni Honkala wrote :
>
>Skip Lawson kirjoitti viestissd <35918F92.DAE28821@sonic.net>...
>>I believe you have to have two \n's
>>print "Content-Type: text/html\n\n"; # HTTP Header Info
>>
>>the Skipinator
>>
>>Jouni Honkala wrote:
>>> print "Content-Type: text/html\n"; # HTTP Header Info
>
>Here the HTML headers continue. If they would end here, then we would
>need two linefeeds to separate them from the text.
>
>>> print "Location: myfile.html\n"; # \n means line feed
>
Of course if one uses CGI.pm (or one of its lightweight offspring, the
module *is* big ) then worries such as this become a thing of the
past:
use CGI;
my $thing = new CGI;
print $thing->header;
That will do "the right thing" under the majority of circumstances.
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 27 Jun 1998 13:10:06 +0100
From: "M. Zschoch" <mzschoch@bc.sympatico.ca>
Subject: Parsing a list of names and assigning each to an arry?
Message-Id: <3594E11E.7F45B1A8@bc.sympatico.ca>
Hello,
Despite reading the FAQ and most of Swartz & Christiansen's Learning
Perl I'm still having trouble with a problem.
Can anyone point me to an example of a method to parse through a file
containing a list of names and assigning each name to an element in an
array?
Thanks in advance.
Regards,
Mark
------------------------------
Date: 27 Jun 1998 20:31:45 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Parsing a list of names and assigning each to an arry?
Message-Id: <6n3krh$6d3$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
"M. Zschoch" <mzschoch@bc.sympatico.ca> writes:
:Can anyone point me to an example of a method to parse through a file
:containing a list of names and assigning each name to an element in an
:array?
while (<>) {
push(@array, split);
}
I'm not sure what good that will do you, though.
--tom
--
Although the Perl Slogan is There's More Than One Way to Do It, I hesitate
to make 10 ways to do something. :-)
--Larry Wall in <9695@jpl-devvax.JPL.NASA.GOV>
------------------------------
Date: Sun, 28 Jun 1998 08:17:11 GMT
From: Marvin Malkowski Jr.
Subject: Perl DB question version upgrade from 5.002 to 5.004_4
Message-Id: <3595fa2a.22246562@gameworld>
We are expericening a problem when we upgrade our server from perl
5.002 to version 5.004_04 when using db files. They seem to have
switch from .db format to .dir and .pag format. My two questions are:
1) Any way we can use the old .db format instead of the new one?
2) how can we access the data that is in the .db files?
Please via email to marv@dw.net if you have any thoughs on the subject
------------------------------
Date: 27 Jun 1998 16:48:30 GMT
From: mikep@rt66.com (mikep)
Subject: Re: Subroutine Variables
Message-Id: <6n37ou$74c$1@news.rt66.com>
In article <3593C588.88421608@cs.purdue.edu>
Alex Svetlev <svetlev@vmw3.ibm.com> writes:
> I have a subroutine with variables that I declare with "my". Each time I
> call this subroutine, the variables still have the values they did in
> the previous call. How can I clear them out? Nothing seems to be
> working. Not local, my, or undef. This doesn't seem like a complex
> thing, but I'm stumped.
Doesn't the local function declare or at least limit an instance of a
variable to its current scope?
===========================
Mike Powell
mikep@rt66.com
http://www.rt66.com/~mikep/
------------------------------
Date: 27 Jun 1998 19:01:42 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Subroutine Variables
Message-Id: <6n3fim$qvm$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
mikep@rt66.com (mikep) writes:
:Doesn't the local function declare or at least limit an instance of a
:variable to its current scope?
Not in the way most people expect. local() doesn't create a local
variable you know. It's just called that to confuse you. :-(
--tom
--
As of next week, passwords will be entered in Morse code.
------------------------------
Date: Sat, 27 Jun 1998 17:46:37 GMT
From: ttwallace@my-dejanews.com
Subject: Re: Uploading perl scripts with a perl script.
Message-Id: <6n3b5t$b9n$1@nnrp1.dejanews.com>
I got this error too, after downloading a perfectly running perl
script onto the server, it caused this error ("Error: No such file
or directory (2)
As it turned out, somehow hidden characters found there way
to the end of each line. Control M's (^M), which are carriage
returns for dos, but apparrently mess up the perl when
run in UNIX (server OS). YOU WILL NOT SEE THESE CHARACTERS IN
WINDOWS OR DOS. My ISP system administrator had to look at the
file to see it. He can delete them, or you can write a perl
script to delete all hidden characters (use hex equivalents).
Good luck!
In article <Pine.GSO.3.96.980619201324.2666D-100000@user2.teleport.com>,
Tom Phoenix <rootbeer@teleport.com> wrote:
>
> On Fri, 19 Jun 1998 rpearce@my-dejanews.com wrote:
>
> > CGIwrap Error: System Error: execv() failed
>
> That's not a Perl error message; it looks as if it's coming from CGIwrap.
> I recommend you check the docs, FAQs, and newsgroups relating to CGI
> scripting and CGIwrap in particular. Good luck!
>
> --
> Tom Phoenix Perl Training and Hacking Esperanto
> Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
>
>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Sat, 27 Jun 1998 17:53:46 GMT
From: ttwallace@my-dejanews.com
Subject: Re: Uploading perl scripts with a perl script.
Message-Id: <6n3bja$bmv$1@nnrp1.dejanews.com>
You probably have hidden characters in your .cgi perl script.
You will not see them in windows or dos editors (like notepad).
I had to look on a UNIX editor to see them when I got this error.
Most likely it is the carriage return (control M which looks like
^M or C/R). This is a very pesky problem. My ISP sytem admin
removed them for me, but I think a clever perl script could to it.
In article <6mej6e$ioo$1@nnrp1.dejanews.com>,
rpearce@my-dejanews.com wrote:
>
> Ok, I've done a search of dejanews to find an answer, but didn't get anything
> clear enough.
>
> Senario: Need to upload a perl script to my ISP's server from work. Work is
> behind a firewall and I can't use ftp/wsftp (tried several firewall settings,
> but none work)
>
> Tried uploading the scripts with a file upload script and a simple create file
> script from a textarea form.
>
> The upload and/or create works, but when I try to run the script I get an
> error message:
>
> CGIwrap Error: System Error: execv() failed
>
> Error: No such file or directory (2)
>
> I believe the second line is referring to the shebang line in the script. It
> can't find perl because of (possibly?) an added \r ?maybe?
>
> I've tried writing a script to strip out \r's after it's been uploaded, but
> still get the same results.
>
> Any pointers or suggestions in the right direction would be appreciated.
>
> Thanks,
>
> Rick...
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/ Now offering spam-free web-based newsreading
>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 27 Jun 1998 16:10:20 -0400
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: Uploading perl scripts with a perl script.
Message-Id: <m3lnqir4gj.fsf@peach.z.org>
ttwallace@my-dejanews.com writes:
> You probably have hidden characters in your .cgi perl script.
> You will not see them in windows or dos editors (like notepad).
> I had to look on a UNIX editor to see them when I got this error.
> Most likely it is the carriage return (control M which looks like
> ^M or C/R). This is a very pesky problem. My ISP sytem admin
> removed them for me, but I think a clever perl script could to it.
perl -pi.bak -e "s/\r//;" file_with_ctrl_M.pl
Will do the trick in most casess. You'll end up with a *.bak file that
is the original in case it does something nasty (not that it ever has
to me).
Jeremy
--
Jeremy D. Zawodny Web Geek, Perl Hacker, etc.
http://www.wcnet.org/~jzawodn/ jzawodn@wcnet.org
LOAD "LINUX",8,1
------------------------------
Date: Sat, 27 Jun 1998 20:25:25 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Uploading perl scripts with a perl script.
Message-Id: <35954e9d.28478228@news.btinternet.com>
On Sat, 27 Jun 1998 17:46:37 GMT, ttwallace@my-dejanews.com wrote :
>
>As it turned out, somehow hidden characters found there way
>to the end of each line. Control M's (^M), which are carriage
>returns for dos, but apparrently mess up the perl when
>run in UNIX (server OS). YOU WILL NOT SEE THESE CHARACTERS IN
>WINDOWS OR DOS. My ISP system administrator had to look at the
>file to see it. He can delete them, or you can write a perl
>script to delete all hidden characters (use hex equivalents).
>
When you upload scripts from a Win/DOS system be sure to use text or
ascii mode and not binary - you will then (hopefully) get the line
ending characters fixed. Of course you can always fix them yourself
with a Perl script that removes the \015 characters from the line
endings.
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Fri, 26 Jun 1998 15:54:33 -0700
From: Pat Taylor <webmaster@earthstations.com>
Subject: What is a Terminator "EOM"???
Message-Id: <359426A9.3A2D0902@earthstations.com>
--------------CE4747DEE0A891CFEE76174F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi,my name is Pat Taylor.
I am by no means a Perl pro and need some help.
I have recently downloaded a Perl script named ax.cgi,this program will
help me to track which banner ads I pay for at various web sites perform
best.
I have been using Telnet to debug my ax-admin.cgi,at the command line I
type perl -w ax-admin.cgi so the script can be debugged.
The output from this request is as follows:Can't find terminator "EOM"
anywhere before EOF at ax-admin.cgi line 1GI line 145.
I will paste line 145 and it's accompanied section to see if anyone can
help me out:
# Load Preferences:
open(PREFS,"$prefs");
@PREFLINES = <prefs>;
close(PREFS);
foreach $PREFLINE (@PREFLINES)
{
($name,$value) = split(/\|/,$PREFLINE);
$PREF{$name} = $value;
}
&authenticate if $password;
&save_prefs;
open(PREFS,">$prefs");
foreach $key (sort keys %PREF)
{print PREFS "$key|$PREF{$key}|\n";}
close(PREFS);
# The line above adds a random query string to this scripts URL. This
# prevents caching on Lynx and MSIE 2.0, and doesn't affect anything
# else.
# Finished with the preferences file.
I hope that someone might be able to inform me as to what is a
"terminator" "EOM",and how would I create this terminator,a visual
description would be greatly appreciated.
I hope that my ignorrance does not offend the group but I would really
appreciate the assistance.
Responses can be made directly to the group or to myself
webmaster@earthstations.com
Thank you all and have a great day and an even better weekend.
Warmest Regards Pat Taylor
--------------CE4747DEE0A891CFEE76174F
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
Hi,my name is Pat Taylor.
<P>I am by no means a Perl pro and need some help.
<P>I have recently downloaded a Perl script named ax.cgi,this program will
help me to track which banner ads I pay for at various web sites perform
best.
<P>I have been using Telnet to debug my ax-admin.cgi,at the command line
I type perl -w ax-admin.cgi so the script can be debugged.
<BR>The output from this request is as follows:Can't find terminator "EOM"
anywhere before EOF at ax-admin.cgi line 1GI line 145.
<BR>I will paste line 145 and it's accompanied section to see if anyone
can help me out:
<CENTER><B># Load Preferences:</B></CENTER>
<CENTER><B> open(PREFS,"$prefs");</B></CENTER>
<CENTER><B>@PREFLINES = <prefs>;</B></CENTER>
<CENTER><B> close(PREFS);</B></CENTER>
<CENTER><B>foreach $PREFLINE (@PREFLINES)</B></CENTER>
<CENTER><B>{</B></CENTER>
<CENTER><B>($name,$value) = split(/\|/,$PREFLINE);</B></CENTER>
<CENTER><B> $PREF{$name} = $value;</B></CENTER>
<CENTER><B>}</B></CENTER>
<CENTER><B> &authenticate if $password;</B></CENTER>
<CENTER><B>&save_prefs;</B></CENTER>
<CENTER><B>open(PREFS,">$prefs");</B></CENTER>
<CENTER><B>foreach $key (sort keys %PREF)</B></CENTER>
<CENTER><B>{print PREFS "$key|$PREF{$key}|\n";}</B></CENTER>
<CENTER><B>close(PREFS);</B></CENTER>
<CENTER><B># The line above adds a random query string to this scripts
URL. This</B></CENTER>
<CENTER><B># prevents caching on Lynx and MSIE 2.0, and doesn't affect
anything</B></CENTER>
<CENTER><B># else.</B></CENTER>
<CENTER><B># Finished with the preferences file.</B></CENTER>
<B>I hope that someone might be able to inform me as to what is a "terminator"
"EOM",and how would I create this terminator,a visual description would
be greatly appreciated.</B>
<P><B>I hope that my ignorrance does not offend the group but I would really
appreciate the assistance.</B>
<P><B>Responses can be made directly to the group or to myself <A HREF="mailto:webmaster@earthstations.com">webmaster@earthstations.com</A></B>
<P><B>Thank you all and have a great day and an even better weekend.</B>
<P><B>Warmest Regards Pat Taylor</B></HTML>
--------------CE4747DEE0A891CFEE76174F--
------------------------------
Date: Sat, 27 Jun 1998 11:04:18 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Re: What is a Terminator "EOM"???
Message-Id: <mbudash-2706981104180001@d200.pm6.sonic.net>
In article <359426A9.3A2D0902@earthstations.com>,
webmaster@earthstations.com wrote:
[snip]
>> The output from this request is as follows:Can't find terminator "EOM"
>> anywhere before EOF at ax-admin.cgi line 1GI line 145.
[snip]
>> I hope that someone might be able to inform me as to what is a
>> "terminator" "EOM",and how would I create this terminator,a visual
>> description would be greatly appreciated.
first off, please don't post to newsgroups in html mail - it's annoying
and needlessly wastes bandwidth. if you don't know how to turn it off,
please ask...
now, your problem won't be *at* line 145, but before. somewhere (above
line 145) the is a statement that looks something like this (there are
variations):
print<<"EOM";
it needs a corresponding EOM later to close it off, and the script can't
find it. send me the cript and i'll see if i can help, or at least post
the lnes from the print statement thru 145...
hth-
--
Michael Budash, Owner * Michael Budash Consulting
707-255-5371 * 707-258-7800 x7736
mbudash@sonic.net
------------------------------
Date: Sat, 27 Jun 1998 18:55:54 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: What is a Terminator "EOM"???
Message-Id: <3595322A.AA3F542@nortel.co.uk>
Content-Type: multipart/alternative;
Uuuh, funky! This is the first time I see code centered!
Pat Taylor wrote:
>
> Hi,my name is Pat Taylor.
> The output from this request is as follows:Can't find terminator "EOM"
> anywhere before EOF at ax-admin.cgi line 1GI line 145.
> I will paste line 145 and it's accompanied section to see if anyone can help
> me out:
> # Load Preferences:
> open(PREFS,"$prefs");
> @PREFLINES = <prefs>;
> close(PREFS);
> foreach $PREFLINE (@PREFLINES)
> ... {print PREFS "$key|$PREF{$key}|\n";}
> close(PREFS);
> I hope that someone might be able to inform me as to what is a "terminator"
> "EOM",and how would I create this terminator,a visual description would be
> greatly appreciated.
>
Consider the following thing...
print <<EOM;
Hello
there
I am being printed
and I don't need any fancy thingies to be printed
EOM
EOM is the string terminator. It has to stand at the BEGINNING OF THE LINE, ALL
BY ITSELF (No ;) <- Ambiguous: No semicolon
Also, you can use any string terminator, provided you defined it with a similar
print statement as above.
Above code doesn't seem to be related to your problem, so look for any print
statements and see if any of those uses a similar contruct.
Also I have heard that the line where EOM stands might have some invisible crap
at the side of it, which might happen during a transfer from Win to UNIX and
similar operations. Hop this helps!
--
____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________
------------------------------
Date: Sat, 27 Jun 1998 14:53:00 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: What is a Terminator "EOM"???
Message-Id: <1dbae76.1rzhwwshdldwsN@bay2-351.quincy.ziplink.net>
[posted and mailed]
Pat Taylor <webmaster@earthstations.com> wrote:
> --------------CE4747DEE0A891CFEE76174F
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
Don't do that.
> I have been using Telnet to debug my ax-admin.cgi,at the command line I
> type perl -w ax-admin.cgi so the script can be debugged.
> The output from this request is as follows:Can't find terminator "EOM"
> anywhere before EOF at ax-admin.cgi line 1GI line 145.
It sounds like you're not familiar with HERE documents.
print <<EOT;
This is a here document.
EOT
You can learn more about them in the perldata documentation, which I
would recommend reading. The answer to your specific question, however,
is in the perlfaq, section 4:
Q: Why don't my <<HERE documents work?
A: Check for these three things:
1. There must be no space after the << part.
2. There (probably) should be a semicolon at the end.
3. You can't (easily) have any space in front of the tag.
> # Load Preferences:
> open(PREFS,"$prefs");
> @PREFLINES = <prefs>;
> close(PREFS);
Perhaps the error message is related to the fact that your code is
centered? Never seen that particular formatting style before...
> I hope that someone might be able to inform me as to what is a
> "terminator" "EOM",and how would I create this terminator,a visual
> description would be greatly appreciated.
The terminator is probably already there, perl just can't find it right
now. See if you need to fix any of the problems mentioned in the FAQ.
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 27 Jun 1998 15:56:56 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: webmaster@earthstations.com
Subject: Re: What is a Terminator "EOM"???
Message-Id: <k9621s2v.fsf@mailhost.panix.com>
Pat Taylor <webmaster@earthstations.com> writes:
> --------------CE4747DEE0A891CFEE76174F
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
Please do not post in MIME. Please do not post in HTML. Please use
plain text only.
> # Load Preferences:
> open(PREFS,"$prefs");
> @PREFLINES = <prefs>;
[etc.]
Please tell us that the script doesn't actually look like this.
Please tell us that it isn't actually centered.
The error message you're getting is letting you know that there's an
unterminated here document in the script, which is no surprise if the
script is formatted as you've shown. If you don't have the foggiest
idea what a here document is, then please see the last paragraph,
below.
> I hope that my ignorrance does not offend the group but I would really
> appreciate the assistance.
Ignorance is not a problem, but this is not the way to go about
learning Perl, which you must do in order to use it. If time is of
the essence for you then you must hire someone who already knows Perl.
If you'd like to learn Perl, then go to http://www.perl.com and read
there about books and training.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf/
------------------------------
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 3004
**************************************