[9467] in Perl-Users-Digest
Perl-Users Digest, Issue: 3061 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jul 4 19:07:20 1998
Date: Sat, 4 Jul 98 16:00:26 -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, 4 Jul 1998 Volume: 8 Number: 3061
Today's topics:
Re: better way of getting the last modified file? (Jonathan Stowe)
Re: Data sent to CGI script via POST into PERL Form (John Hocking)
Re: Editeurs pour Perl? (Jonathan Stowe)
Re: filtering out garbage characters from post/get (Jonathan Stowe)
Re: first language (Jonathan Stowe)
Re: first mess up <howard@vortexweb.com>
Re: Help with CGI Please (Josh Kortbein)
Re: Help with Programming (John Hocking)
Re: HELP: Problem building Perl5 on Cygnus target (Jonathan Stowe)
Re: How do chang groups (Jonathan Stowe)
Re: invoking shells... (Jonathan Stowe)
Re: passing javascript var in perl cgi (Jonathan Stowe)
perl asp question <ee@juno.com>
Re: Perl Editor for Windows NT ? (Jonathan Stowe)
Perl to Browser IO problem <douglas@home.com>
Re: Perl to Browser IO problem (Jonathan Stowe)
Re: perl with Mysql (Jordyn A. Buchanan)
Re: Perl, is it threaded? (Dan Sugalski)
print $ENV{'PATH_INFO'} problem <slayer.man@usa.net>
print $ENV{'PATH_INFO'} problem <slayer.man@usa.net>
Re: print $ENV{'PATH_INFO'} problem (Jonathan Stowe)
Re: print $ENV{'PATH_INFO'} problem <slayer.man@usa.net>
Re: replacing search variable in foreach (Jonathan Stowe)
Script text editor <willdeb@adelphia.net>
Re: Script text editor (Michael Rubenstein)
Re: Script text editor (Jonathan Stowe)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 04 Jul 1998 19:35:17 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: better way of getting the last modified file?
Message-Id: <359e7c21.21187813@news.btinternet.com>
On Sat, 04 Jul 1998 07:35:30 -0400, Eugene Sotirescu wrote :
>I'm getting the last modified file in a directory thusly:
>
> @my_files = `ls -t $DIR`;
> $myfile = $my_files[0];
>
>Is there any better way of doing this, without spawning a shell?
>
check out perlfunc for the -X stuff
i.e :
perldoc -f -X
or whatever "man perlfunc" then /-X blah blah
Perl has a whole shed-load of ways of finding this kind of stuff out.
>Thanks.
>
Anyhow did you hear that Louise Woodward got a new job as the manager
of The Spice Girls now she's been let out ? The first thing she's
going to do apparently is drop Baby Spice.
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 04 Jul 1998 20:44:50 GMT
From: joker@inlink.com (John Hocking)
Subject: Re: Data sent to CGI script via POST into PERL Form
Message-Id: <35a29421.83281693@news.inlink.com>
On Fri, 26 Jun 1998 23:22:58 GMT, sfnichols@my-dejanews.com wrote:
><td>
><textarea row=6 cols=75 wrap="virtual" name="Bod1" ></textarea>
></td>
>
Your problem might be the wrap="virtual"
this gives the person entering data in the form a word wrap but the
data comming to the perl script does not wrap.
Are you pressing "enter" after each line?
have you tried pressing "enter" twice after each line to give a line
break between?
You might also try changing your wrap to pshyical as see that that
gives you what you want.
John Hocking
Sr. Programmer
StudioPointe Incorporated
http://www.studiopointe.com
mailto:johnh@studiopointe.com
------------------------------
Date: Sat, 04 Jul 1998 19:35:21 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Editeurs pour Perl?
Message-Id: <359e7fec.22158557@news.btinternet.com>
On Thu, 02 Jul 1998 12:16:03 +0200, CRETEL Dominique wrote :
>Bonjour tout le monde,
>
>Je sais, cela doit etre la n-ieme fois que quelqu'un parle de cela!
>
>Mais, etant un nouvel utilisateur de Perl, j'aimerais savoir si il exite
>un bon editeur pour Perl, si possible freeware, ou il y aurait une aide
>en ligne sur les mots clis de Perl (ex: Shift F1 sur le mot cle GREP).
>
There are plenty of good editors out there, some of which might make a
fair fist of syntax highlighting but as far as I know there are none
that will be able to provide assistance in that manner although it
might be possible with some of the more configurable editors available
to write a macro to do that.
>Merci de votre aide,
>Dominique Cretel
Pas de problem copain
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 04 Jul 1998 21:38:58 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: filtering out garbage characters from post/get
Message-Id: <359e9a48.28906478@news.btinternet.com>
On Mon, 29 Jun 1998 19:52:32 -0500, Jason Chancellor wrote :
>I have been able to filter out specific characters from a string using
>the tr command,
>but I want some way to filter out ALL characters except "a-Z" , "0-1"
>and "space"
>
>Im sure this is easy, I just cant figure it out.
>
Well I'm sure that a perusal of the perlre document would be of great
assistance to you in this matter.
Pick your weapon as appropriate to your platform:
$ man perlre
C:\> perldoc perlre
The documentation dont you just love it.
>Help greatly appreciated.
>
Beer greatly appreciated
> Jason
>
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 04 Jul 1998 21:39:00 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: first language
Message-Id: <359e9c23.29381689@news.btinternet.com>
On Mon, 29 Jun 1998 19:41:53 -0400, Bill Guenthner wrote :
>Hey Judson, I just defended you on the COBOL issue but this time you're
>wrong.
>
>Private Sub Form_GotFocus()
>Form1.Print "hello world"
>End Sub
>
>The fact that "The user interfaces are *totally* different" has no bearing
>on the language.
>a Unix C++ or Visual C++ is still C++. BASIC is BASIC.
>
That is not strictly correct in both case: Visual C++ *is* a C++ that
*happens* to largely depend on a monolithic proprietary class library
and an over clever IDE, so yes one could treat it as an ordinary C++
as far as the available libraries would allow. However Visual Basic
merely employs a BASIC-like syntax : BASIC per-se does not have
objects, classes, or event handlers: the design of BASIC does not
allow for a framework to take responsibilty for the flow of control as
it can in C++ - This is the reason, as I see it, why Borland did not
call Delphi Visual Pascal or something similar. The snip of code you
cite above is not valid BASIC code - but its moral equivalent from
Visual C++ would be valid C++ given the correct class libraries.
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 4 Jul 1998 15:25:18 -0500
From: "Howard Dierking" <howard@vortexweb.com>
Subject: Re: first mess up
Message-Id: <OZpuyj4p9GA.256@upnetnews05>
I corrected the syntax stuff I think--at least I I don't think this sounds
like a syntax error:
exec of /usr/local/etc/httpd/cgi-bin/validateid.pl failed, errno is 2
[Sat Jul 4 13:14:47 1998] access to
/usr/local/etc/httpd/cgi-bin/validateid.pl
failed for 1cust103.tnt1.hou1.da.uu.net, reason: Premature end of script
headers
(that's the error)
Is there a list somewhere of errors and what they mean exactly?
thanks
------------------------------
Date: 4 Jul 1998 21:25:37 GMT
From: kortbein@iastate.edu (Josh Kortbein)
Subject: Re: Help with CGI Please
Message-Id: <6nm6kh$97n$1@news.iastate.edu>
Mark Hill (mark.hill1@virgin.net) wrote:
: My ISP does not allow CGI scrips at the moment,(I may now have found
: one).
: I want to include a simple word search on my site similar to the
: one on this page
: http://www.systemsoft.com/
Why not just link to AltaVista or one of the other search engines
which will allow you to use a linkback to your site? That should be
sufficient for a personal web page.
If this is for something bigger or more commercial (where you want
to look like you're doing everything yourself) then you need to get
a different ISP.
BTW, this didn't really have anything to do with perl, except that
perl is a language you might choose to write CGI scripts in.
Josh
--
__________________________________________
She had heard all about excluded middles;
they were bad shit, to be avoided.
- Thomas Pynchon
------------------------------
Date: Sat, 04 Jul 1998 20:38:55 GMT
From: joker@inlink.com (John Hocking)
Subject: Re: Help with Programming
Message-Id: <35a09012.82242071@news.inlink.com>
On 26 Jun 1998 12:04:01 -0700, chiherbs@primenet.com (Bruno Pisano)
wrote:
>I develop web sites, and trying to get into more complex
>programming.
>Searching through CGI/Perl, ASP and Cold Fusion.
>To build sites that need search capabilities and
>shopping cart, what would you recommend I learn, which
>is the easiest and most practical?
My advice is to learn to program in CGI/Perl.
Perl is available for most servers that I know of.
ASP will only work on Microsoft IIS servers without special server
upgrades. You can get chilisoft's chiliASP to run ASP on a netscape
server.
You need to run a cold fusion server to get all the benifits of Cold
fusion and not one of the local ISP's here use it.
If you go with Perl, and your server does not have it you could easily
get it for them for free!
If you want a really good book for learning perl from the ground up I
recommend:
Perl 5 Interactive Course : Certified Edition
by Jon Orwant
Waite Group Press; ISBN: 1571691138
This book is like a college course in perl
it introduces topics slowly and tests you on what you learned after
each chapter.
John Hocking
Sr. Programmer
StudioPointe Incorporated
http://www.studiopointe.com
mailto:johnh@studiopointe.com
------------------------------
Date: Sat, 04 Jul 1998 19:35:19 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: HELP: Problem building Perl5 on Cygnus target
Message-Id: <359e7e58.21754913@news.btinternet.com>
On 4 Jul 1998 16:48:54 GMT, Bbirthisel wrote :
>Hi Jonathan and Cretel:
>
>>gcc2 is a shell script I think - if it is and you look at it you will
>>find that the #! line points to a non-existent interpreter : check the
>>path to your version of bash.
>
>The README file for Cygnus in the perl source distribution used to
>suggest that you create a distinct "/bin" directory and move a couple
>of things including "gcc2" into it. I don't have the lastest version in
>front of me - but I suspect a similar recommendation still exists.
>
You're almost certainly right. But nonetheless if gcc2 *is*
executable and in the PATH then the message from the shell indicates
to me that the Interpreter described in the shebang line is incorrect
- this goes for Perl programs giving a similar type of error.
>-bill
>Making computers work in Manufacturing for over 25 years (inquiries welcome)
/J\
Making computers work in Local Government for, Ooh, at least twenty
minutes at a time.
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 04 Jul 1998 19:35:22 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: How do chang groups
Message-Id: <359e814d.22511835@news.btinternet.com>
On 2 Jul 1998 23:08:27 GMT, Scott Anderson wrote :
>Hi,
>Is it possible to have perl change a users group id?
>
>$grp = $(;
>$groupname = getgrgid($grp);
>
>gets the current group name correctly. So, I tried
>
> $( = $grpnum;
>
>and got an error message telling me setgid was not implemented. Is there some
>other way to change groups? I haven't had much luck finding info on this
>topic so I would be grateful for any help.
>
Most usually when Perl claims that some function or other is not
implemented on your platform you can be pretty sure that it is telling
the truth - however if you did not compile Perl yourself and you are
sure that the setgid() C library function is available to you (which
is fairly certain on a SVR4 type system ) then you might want to
rebuild Perl yourself and check that it is doing the right thing.
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 04 Jul 1998 21:38:55 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: invoking shells...
Message-Id: <359e8933.24532855@news.btinternet.com>
On Mon, 29 Jun 1998 12:12:22 -0500, Bryan Gran wrote :
>I am writing some code in which I am invoking a separate shell (there is
>really no good way around this). Right after I invoke the shell I would
>like to exit it, and continue executing the script.
>I tried two sequential system calls, but they are invoked in the same
>shell, so only after manually exiting the second shell does the second
>system call execute.
>
check out the documentation for the fork and exec builtin functions in
the perlfunc manpage. system() does an implicit fork(),exec(),wait()
but by removing the wait() until the last possible moment before your
programs termination you can run your scripts asynchronously.
>Anyone have any ideas? Please reply via email to the address below.
>
I have loads of Ideas most of which you would not like cluttering up
your mailbox.
Anyhow. David Beckham goes to the sperm bank ...
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 04 Jul 1998 19:35:15 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: passing javascript var in perl cgi
Message-Id: <359e743f.19286254@news.btinternet.com>
[posted and mailed]
On Sat, 04 Jul 1998 10:45:23 -0400, Yan Zhu wrote :
>hi all:
> I have a cgi in perl creates a dynamic html. the html page includes
>javascript which get cookie values from the client. My question is, how
>do I take the value of the cookie and stick it into a perl variable?
I dont know is this Perl, is this CGI, is this Javascript ?
The thing here is you probably dont need to use the javascript to get
the cookie if you do the right thing with CGI.pm but that is probably
better answered by the documentation for that module.
Alternatively, you might feel that you want to use the Javascript
anyway and if this was comp.lang.javascript I would probably give you
an answer but it isnt and I wont. You could probably get an answer
from the Netscape documentation for JavaScript I suppose (and there is
plenty of it.)
As a third option you might check out the HTTP and CGI specifications
and see how the whole matter of cookies is dealt with.
> thanks a lot.
> email if possible please. :)
Just this once.
>
Did you know that they took Alphabetti Spaghetti off the market
because you could get BSE from it?
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 4 Jul 1998 18:59:34 -0400
From: "ee" <ee@juno.com>
Subject: perl asp question
Message-Id: <6nmc3m$kek@bgtnsc03.worldnet.att.net>
The following is my attempted perl port of a vbscript example. It should
open a file and display all of its contents.
<%
$filesys = $Server->CreateObject("Scripting.FileSystemObject");
$filea = $filesys->OpenTextFile("c:\inetpub\wwwroot\copy.txt");
$Response->write ($filea->ReadAll);
%>
However I get the following message:
$filea = $filesys->OpenTextFile("c:\inetpub\wwwroot\copy.txt");
$Response->write ($filea->ReadAll); error '80004005'
Can't call method "ReadAll" without a package or object reference.
/test.asp, line 17
Does someone know what I'm doing wrong.
Thanks
Frederik Sims
efs@rocketmail.com
ps. this is the vbscript sample that works
<%
Dim fs, a
set fs = CreateObject ("Scripting.FileSystemObject")
Set a = fs.OpenTextFile("c:\inetpub\wwwroot\copy.txt")
Response.Write (a.ReadAll)
a.Close
%>
------------------------------
Date: Sat, 04 Jul 1998 21:38:53 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Perl Editor for Windows NT ?
Message-Id: <359e8666.23816303@news.btinternet.com>
On 29 Jun 1998 10:09:17 GMT, Uwe Hauck wrote :
>Hello !
>Does anyone know of any Editor (best would be freeware)
>for Windows NT that understands Perl Syntax ?
>I want something that will highlight my Perl code according
>to perl standards an best would be if it would do some sort
>of syntax check too..
>
My preference is elvis, I used before it was able to do keyword
highlighting but now it does and I wouldnt use any thing else. Of
course its a vi, it dont have a gui - but those are plus points really
arent they ? You might want to think about the difference between
syntax higlighting and the syntax checking that you seem to want. It
is an oft stated truism that the only thing that can check Perl syntax
is perl itself (or of course an experienced human eye).
>Uwe
>
>Please send mail to PBUHauck@t-online.de too as I am not in here
>to often..
I am sorry about the Brazil result but I just cant bring myself to
mail this.;-}
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 04 Jul 1998 20:27:01 GMT
From: Douglas Galbraith <douglas@home.com>
Subject: Perl to Browser IO problem
Message-Id: <359E8FFA.49E10DA4@home.com>
Hello, and thanks for the help in advance;
I've installed perl on my Windows95 machine, and I'm having difficulty
getting my browsers to execute a script. Specifically, the contents of
this script fail to dump into the browser window. Instead, it opens a
DOS window and dumps there.
Below is a perl script called "a.pl":
-----------------------------------------------------------------
#!/perl/bin/perl
print ("Content-type: text/html\n\n");
print("<HTML>\n");
print("<HEAD><TITLE>Here is the title</TITLE></HEAD>\n");
print("<BODY><P>Here is the body</BODY>\n");
print("</HTML>\n");
exit (0);
-----------------------------------------------------------------
If I use a browser to run it ("c:/temp/a.pl"); the browser starts a
"file download" and asks me if I would like to open it or save it to
disk. I click on "Open it", at which point a DOS window opens, the
script executes, and dumps its contents into this DOS widow, but NOT
into the browser widow.
How do I get this script to print into the browser window?
I assumed that the IO automatically redirected into the browser if the
browser called it, but that does not seem to be the case.
Below is my system configuration:
system: Windows95 (4.00.950a)
perl version: perl 5.003_07
perl download:
ftp://ftp.activestate.com/Perl-Win32/Release/Pw32i316.exe
browsers: Internet Explorer 3.02
browsers: Netscape Communicator 4.02
I've associated the ".pl" extension with perl.exe through the widows
"registered file types" so Windows95 will execute all files with the
".pl" as perl scripts. (Note: this association does NOT work in a DOS
window.)
If I run this script in a DOS window (e.g. "perl a.pl"), it prints HTML
contents to the screen with no problems.
If I run this script through Windows95 Explorer (double click on
"a.pl"), it opens a DOS window and prints HTML contents to it with no
problems.
thanks for the help;
DGalbra862@aol.com
------------------------------
Date: Sat, 04 Jul 1998 22:17:48 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Perl to Browser IO problem
Message-Id: <359ea407.31400952@news.btinternet.com>
On Sat, 04 Jul 1998 20:27:01 GMT, Douglas Galbraith wrote :
>Hello, and thanks for the help in advance;
>
>I've installed perl on my Windows95 machine, and I'm having difficulty
>getting my browsers to execute a script. Specifically, the contents of
>this script fail to dump into the browser window. Instead, it opens a
>DOS window and dumps there.
>
But you just cant go doing CGI without an HTTP server now can you ?
This question gets asked here quite a lot but it hasnt made the Perl
FAQ because it has nothing to with Perl. The way that you describe
that you are running your scripts and the results you get are entirely
consistent. YOU NEED AN HTTP SERVER TO DO CGI. This has been
discussed here before - search DejaNews or ask in an appropriate
comp.infosystems.www.servers.* group to your platform (or even better
its FAQ ) about installing and configuring an HTTP server. There even
servers written in Perl but I think you probably want to look at a
more conventional server before you start playing with that kind of
stuff.
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 04 Jul 1998 16:24:38 -0400
From: jordyn@bestweb.net (Jordyn A. Buchanan)
Subject: Re: perl with Mysql
Message-Id: <jordyn-0407981624380001@vermeer.bestweb.net>
In article <359DD3A0.57A3D3E2@ehb.iac.net>, ehb@iac.net wrote:
> I am fairly new to Perl and CGI... However, I have begun to see what a
> pain it is to use flat text files as databases. Could someone please
> point me to a website or other source that will show me how to use Mysql
> server with Perl 5??? I would appreciate this SO SO Much... I have been
> going crazy trying to get this thing to work....
If you look through CPAN (www.cpan.org) you'll find a module that works
with Mysql quite nicely; there are also modules for many other databases.
There are also modules that make it a lot easier to deal with data in text
files, but for many applications a database is your best choice.
Jordyn
------------------------------
Date: 4 Jul 1998 18:43:30 GMT
From: sugalsd@peak.org (Dan Sugalski)
Subject: Re: Perl, is it threaded?
Message-Id: <6nlt4i$pbi$1@bashir.peak.org>
Robert Garskof (robert.garskof@nospam.snet.com) wrote:
: Will these be green/user threads or kernal threads?
It depends. Perl will use whatever sorts of threads your OS provides. If
your OS provides kernel threads, those'll likely be what perl will use.
Dan
------------------------------
Date: Sat, 4 Jul 1998 23:30:54 +0200
From: "Mark Stier" <slayer.man@usa.net>
Subject: print $ENV{'PATH_INFO'} problem
Message-Id: <359ea4f7.0@hebel.rol3.com>
Hello,
the following perl code (under SuSE Linux 5.1/2.0.32 perl 5.004 apache 1.2.6
gcc 2.7.2.1) does not produce output as wanted (but a similar code prooves
that it normally does):
----
# script "new-category"
require "config";
print "$Html_AddCategory\n\n</center>\n\n";
# config file "config"
$Html_AddCategory = "<form
action=\"/ext-cgi/add-category$ENV{'THIS_PATH'}\" method=\"GET\">\n <input
type=\"text\" size=\"38\" name=\"name\"><br>\n <input type=\"checkbox\"
name=\"view\"> disable<p>\n <input type=\"SUBMIT\" value=\"Create
Category\">\n</form>";
---
The problem is that the expression $ENV{'PATH_INFO'} is just replaced by a
zero length string (""). When adding it to the print function itself (not
indirectly by adding it to the variable in the config file), it prints the
real PATH_INFO.
It seems to me that perl is somewhat instable at this point. Or is there
something to be beware of?
Thank you, Mark
------------------------------
Date: 4 Jul 98 22:53:13 GMT
From: Mark Stier <slayer.man@usa.net>
Subject: print $ENV{'PATH_INFO'} problem
Message-Id: <359eb259.0@hebel.rol3.com>
------------------------------
Date: Sat, 04 Jul 1998 22:37:06 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: print $ENV{'PATH_INFO'} problem
Message-Id: <359eac52.33523089@news.btinternet.com>
On Sat, 4 Jul 1998 23:30:54 +0200, Mark Stier wrote :
>Hello,
>
>the following perl code (under SuSE Linux 5.1/2.0.32 perl 5.004 apache 1.2.6
>gcc 2.7.2.1) does not produce output as wanted (but a similar code prooves
>that it normally does):
>
>----
>
># script "new-category"
>require "config";
>print "$Html_AddCategory\n\n</center>\n\n";
>
># config file "config"
>$Html_AddCategory = "<form
>action=\"/ext-cgi/add-category$ENV{'THIS_PATH'}\" method=\"GET\">\n <input
>type=\"text\" size=\"38\" name=\"name\"><br>\n <input type=\"checkbox\"
>name=\"view\"> disable<p>\n <input type=\"SUBMIT\" value=\"Create
>Category\">\n</form>";
>
>---
>
>The problem is that the expression $ENV{'PATH_INFO'} is just replaced by a
>zero length string (""). When adding it to the print function itself (not
>indirectly by adding it to the variable in the config file), it prints the
>real PATH_INFO.
>
>It seems to me that perl is somewhat instable at this point. Or is there
>something to be beware of?
I've gotta say that you havent got an $ENV{PATH_INFO} in that at all.
That said and assuming that its omission from your file is merely a
typo - you would still be better off if you used CGI.pm and its
path_info() method.
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sun, 5 Jul 1998 00:54:43 +0200
From: "Mark Stier" <slayer.man@usa.net>
Subject: Re: print $ENV{'PATH_INFO'} problem
Message-Id: <359eb2b7.0@hebel.rol3.com>
Hell, yes. Sorry.
------------------------------
Date: Sat, 04 Jul 1998 21:38:57 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: replacing search variable in foreach
Message-Id: <359e8b38.25049864@news.btinternet.com>
On Sat, 4 Jul 1998 13:23:49 -0400, Ronald J Kimball wrote :
>- <root.noharvest.\@not_even\here.com> wrote:
>
>>
<snip>
>> I never use return
>> values, and my programs work great.
>
>I'll be watching for a post from you like this...
>
>---
>Why doesn't this script work?
>
<snip>
>
>I notice you also hard code the socket define values
><35963800.149945650@news2.cais.com>, ignore case-sensitivity in module
>names <358b0cb2.249309455@news2.cais.com>, and are ignorant of sprintf
><3581a69b.16861879@news2.cais.com>.
>
<snip>
Way to go Ron ! And I thought I had an unfortunate memory.
The thing we have here is that there are people out there who might be
able to demonstrate a reasonable degree of proficiency as creators of
little Perl scripts within a relatively controlled or convivial
environment and might be able to convince some of their peers or
superiors of that - of course sometime they might fail but hey !
There is no substitute for programming experience or experience of
working through the whole product life cycle - Perl is a relatively
easy language for someone of reasonable intelligence to become
apparently productive in without ever having the need to become highly
skilled as a professional developer of software.
It is probably too easy to go barrel fish shooting around here, I have
to confess that Perl is only a minor ranking skill on my CV - I was
employed initially with my current employers as an Informix/Unix
product specialist, but so many files have been frigged, so may
reports fixed up, so many data conversions, interfaces, transfers and
so on and so forth in Perl that it is my de facto choice for any job
that it is capable to do - (and we all know there are things you wont
do in Perl.)
Anyhow. David Beckham walks into the Sperm bank and says he wants to
make a donation. The nurse asks him whether he has donated before to
which he answers positively. "Ok I'll just look on the computer for
your details" she says. After a short while she looks up and says :
"I'm sorry Mister Beckham but you'll have to wait until we can get
Posh Spice here before you can make your donation". "Why's that?", he
say's. "Well it says on your file you're a Useless wanker ..."
;-}
Thats the end of football for now.
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 04 Jul 1998 21:19:59 GMT
From: "Legend" <willdeb@adelphia.net>
Subject: Script text editor
Message-Id: <30xn1.36$3Z2.498983@news.axxsys.net>
This is a multi-part message in MIME format.
------=_NextPart_000_00A5_01BDA76F.E1A77B20
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I have been advised that carriage returns are death to scripts. Can =
anyone recommend an editor that will not put cr's in the script?
Will
CompwareUSA
------=_NextPart_000_00A5_01BDA76F.E1A77B20
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML><BASE href=3Dfile://C:\PROGRA~1\COMMON~1\MICROS~1\STATIO~1\>
<HEAD>
<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type><BASE=20
href=3Dfile://C:\PROGRA~1\COMMON~1\MICROS~1\STATIO~1\><HTML>
<META content=3D'"MSHTML 5.00.0518.7"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>I have been advised that carriage returns are death to scripts. Can =
anyone=20
recommend an editor that will not put cr's in the script?</DIV>
<DIV> </DIV>
<DIV>Will</DIV>
<P><A href=3D"http://www.compwareusa.com"><EM><STRONG><BIG><BIG><FONT=20
color=3D#000080 face=3DArial>Compware</FONT><FONT color=3D#ff0000=20
face=3DArial>USA</FONT></BIG></BIG></STRONG></EM></A></P></BODY></HTML>
------=_NextPart_000_00A5_01BDA76F.E1A77B20--
------------------------------
Date: Sat, 04 Jul 1998 21:51:00 GMT
From: miker3@ix.netcom.com (Michael Rubenstein)
Subject: Re: Script text editor
Message-Id: <359ea145.25864491@nntp.ix.netcom.com>
On Sat, 04 Jul 1998 21:19:59 GMT, "Legend" <willdeb@adelphia.net>
wrote:
>I have been advised that carriage returns are death to scripts. Can anyone recommend an editor that will not put cr's in the script?
Where did you hear that?
It's true under Unix, but editors that run under Unix don't put
carriage returns in the file unless you intentionally do it (in the
editors I'm aware of, it's very hard to do this accidently).
Under Windows 32 scripts, like any other text files, should terminate
lines with a carriage return/line feed. This will cause no problem
for perl.
If I recall correctly, on the Macintosh text file lines normally end
with a carriage return only.
When you transfer a script from one platform to another, you should
convert to the proper text format for that platform. Even if Perl
doesn't care, you'll be happier if the native tools work with your
scripts. When using FTP, just transfer using text mode. unzip, at
least for Unix and Win32, has an option to convert files when it
extracts them from the archive. If nothing else, it's generally
pretty easy to write a perl script that will do the conversion.
--
Michael M Rubenstein
------------------------------
Date: Sat, 04 Jul 1998 22:17:50 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Script text editor
Message-Id: <359ea66a.32011608@news.btinternet.com>
On Sat, 04 Jul 1998 21:19:59 GMT, Legend wrote :
>This is a multi-part message in MIME format.
>
>------=_NextPart_000_00A5_01BDA76F.E1A77B20
>Content-Type: text/plain;
> charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>
Now you won't do this again having seen how horrible it looks to
everyone else now will you? Usenet has no use for this stuff and all
but the most lame newsreaders/browsers even attempt to use it (except
for a saintly few which just wipe it out). Check out the
documentation for your browser if you are unsure how to prevent it
from doing this.
>I have been advised that carriage returns are death to scripts. Can =
>anyone recommend an editor that will not put cr's in the script?
>
No. You have been advised incorrectly. A Perl interpreter for a
given platform will correctly understand the line end convention for
that platform. However the text format may not be portable between
varying platforms - say between DOS and Unix. If you are transferring
Perl files between two platforms with FTP you want to be sure that you
use ASCII mode in order that the software perfroms the correct
translations for line end characters. If you are using some other
method of transferring files (such as samba or NFS) then you might
want to look at an editor that will let you save in the appropriate
format such as PFE (Programmers File Editor) or SuperNoteTab on the
windows platform.
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
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 3061
**************************************