[9475] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 3069 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 6 21:08:04 1998

Date: Mon, 6 Jul 98 18:03:53 -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           Mon, 6 Jul 1998     Volume: 8 Number: 3069

Today's topics:
    Re: Help: perl5.00404 and UnixWare 2.1.2 (locale proble (Sitaram Chamarty)
        Help: testing cgi's locally nasty-eye@nasty-eye.com
    Re: Help: testing cgi's locally <quednauf@nortel.co.uk>
    Re: Help: testing cgi's locally <chris.wareham@blackwell.co.uk>
    Re: Help: testing cgi's locally <dtbaker_@flash.net>
    Re: Help: testing cgi's locally <mbohlman@pdnt.com>
        how to write to a root owned file using setuid in perl? bthak@bascom.com
        HTML Tables in PERL from SQL query djgaus@nb.net
        HTTP connections WITHOUT the libwww module? <domainsource@usa.net>
    Re: HTTP connections WITHOUT the libwww module? <jdf@pobox.com>
    Re: HTTP connections WITHOUT the libwww module? (Jeremy D. Zawodny)
    Re: HTTP connections WITHOUT the libwww module? (brian d foy)
    Re: I NEED SOME HELP (Martien Verbruggen)
    Re: i've got a forking problem (Mike Wescott)
        inetinfo sticks in NT <erik@zeno.com>
    Re: inetinfo sticks in NT (Larry Rosler)
    Re: inetinfo sticks in NT (Martien Verbruggen)
    Re: inetinfo sticks in NT (Jeremy D. Zawodny)
        invoking java from a cgi script. <rao_madhavrao@bmc.com>
    Re: invoking java from a cgi script. (Josh Kortbein)
    Re: invoking java from a cgi script. (Martien Verbruggen)
    Re: invoking java from a cgi script. mgscheue@io.com
    Re: Is Perl through CGI enough for this? (David Rouse)
    Re: Length and stripping function (Martien Verbruggen)
    Re: limits of glob() ? and number of sub-dirs in win95 <admin@palisade.com>
    Re: limits of glob() ? and number of sub-dirs in win95 <dennis.kowalski@daytonoh.ncr.com>
    Re: limits of glob() ? and number of sub-dirs in win95 <dtbaker_@flash.net>
    Re: limits of glob() ? (Clinton Pierce)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 6 Jul 98 04:25:01 GMT
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: Help: perl5.00404 and UnixWare 2.1.2 (locale problem)
Message-Id: <slrn6q0jrh.kk7.sitaram@ltusitaram.diac.com>

On Sun, 05 Jul 1998 18:00:12 -0500, Dennis Golden <dlgolden@ibm.net> wrote:

>> Figure out how that's getting set in your failing case, or unset
                                                              ^^^^^
>> it forcibly and try again.
   ^^^^^^^^^^^
>Yes I did notice this and I have no control over the environment because

Notice what I said above (underscored now).  Unset it forcibly in
the outermost scope of your program.  If the outermost one is
shell
    unset LC_MESSAGES
or if Perl (IIRC it *was* Perl...)
    delete $ENV{LC_MESSAGES}

Then continue on your merry way.

Just because lpsched was not installed right and insists on
setting inconsistent env vars doesn't mean you have to live with
it.  It may not be the "right" solution, but it should get you
going until you find the right one.

Good luck.


------------------------------

Date: Sat, 04 Jul 1998 17:38:48 GMT
From: nasty-eye@nasty-eye.com
Subject: Help: testing cgi's locally
Message-Id: <6nlpbo$5k9$1@talia.mad.ibernet.es>

I'm going to install in my site(it's a virtual domain) a flat text
database driven from the browser by a perl cgi.   I'd like to test the
cgi before installing it online.  
I have Perl Win32 in my computer, and I thought that I could change
some code(the path to perl, etc)  and execute the cgi, but when I call
the cgi from the form in the browser nothing happens.(I know the
browser finds the cgi because I have no error message).

I'd like  to know if the only way to run cgi's is online.

Please help this perl newbie.

Ruben. 



------------------------------

Date: Mon, 06 Jul 1998 12:45:17 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: Help: testing cgi's locally
Message-Id: <35A0B8CD.7A70AEBE@nortel.co.uk>

nasty-eye@nasty-eye.com wrote:

> 
> I'd like  to know if the only way to run cgi's is online.

Online yes, but you can be locally online on the loopback IP 127.0.0.1 . A
webserver is needed to do the job of calling the Perl interpreter, and direct
the output of your script to your browser. Your browser can't understand a Perl
script, if the *.pl file is known to your system it will merely call the default
program for dealing with your Perl scripts. That is likely to be a Dos box. 
See for a text I have written a while ago tha explains what you might want to
do, it is temporarily on my webpage, see the sig (main page).
-- 
____________________________________________________________
Frank Quednau               
http://www.surrey.ac.uk/~me51fq
________________________________________________


------------------------------

Date: Mon, 06 Jul 1998 13:08:04 GMT
From: Chris Wareham <chris.wareham@blackwell.co.uk>
Subject: Re: Help: testing cgi's locally
Message-Id: <35A0CCCC.633FFD80@blackwell.co.uk>

nasty-eye@nasty-eye.com wrote:
> 
> I'm going to install in my site(it's a virtual domain) a flat text
> database driven from the browser by a perl cgi.   I'd like to test the
> cgi before installing it online.
>

If you're using the CGI module, (and for any serious sized CGI script I
can strongly recommend it), then it has an `offline' mode. You can just
run the script from the shell, and it prompts you for values to be
submitted.

Chris
-- 
chris.wareham@blackwell.co.uk
+44 (0)1865 792792 ext. 3381


------------------------------

Date: Mon, 06 Jul 1998 10:03:17 -0500
From: Dan Baker <dtbaker_@flash.net>
Subject: Re: Help: testing cgi's locally
Message-Id: <35A0E735.1150@flash.net>

nasty-eye@nasty-eye.com wrote:
> 
> I'm going to install in my site(it's a virtual domain) a flat text
> database driven from the browser by a perl cgi.   I'd like to test the
> cgi before installing it online.
> I have Perl Win32 in my computer, and I thought that I could change
> some code(the path to perl, etc)  and execute the cgi, but when I call
> the cgi from the form in the browser nothing happens.(I know the
> browser finds the cgi because I have no error message).
> 
> I'd like  to know if the only way to run cgi's is online.
> 
> Please help this perl newbie.
> 
> Ruben.
--------------------
you have to have a webserver running locally... I am going to have to
try this myself in the next week or so. There are some free ones
available for download, but I haven't tried them yet.

the smallest/simplest one I found so far was from xitami.

Dan



------------------------------

Date: Mon, 06 Jul 1998 09:58:33 -0500
From: Mike Bohlmann <mbohlman@pdnt.com>
To: nasty-eye@nasty-eye.com
Subject: Re: Help: testing cgi's locally
Message-Id: <35A0E619.F1AF251E@pdnt.com>

[ author CC'd via e-mail ]

nasty-eye@nasty-eye.com wrote:
 
> I have Perl Win32 in my computer, and I thought that I could change
> some code(the path to perl, etc)  and execute the cgi, but when I call
> the cgi from the form in the browser nothing happens.(I know the
> browser finds the cgi because I have no error message).

Do you have a web server running on your computer?  I'm guessing
that that is your problem.  Just linking to a script on your computer
isn't going to run it.  In order for it to work through an HTML
document on your computer, you need it to go through an actual
web server.  There are a few freely available HTTP servers available
that you can use, but that may be more trouble than it's worth.  See
below.
 
> I'd like to know if the only way to run cgi's is online.

You are using CGI.pm, right?  You can run the script from the command
line and do some excellent debugging work.  Upload your script to
your web host and telnet in.  Make sure it is executable and type
 ./myscript to run it.  It should give the following line:

(offline mode: enter name=value pairs on standard input)

Type your name=value pairs that you want to test, each followed
by enter.  ie.

name=John Doe
address=Timbuktu
email=johndoe@blah.com

After you've entered them all in, press ^D and your script will output
to the screen.  Do a man CGI to read more.

Mike

-- 

Mike Bohlmann, MAIP				mbohlman@pdnt.com
Internet Strategy and Development Consultant


------------------------------

Date: Mon, 06 Jul 1998 23:13:26 GMT
From: bthak@bascom.com
Subject: how to write to a root owned file using setuid in perl?
Message-Id: <6nrlmm$b95$1@nnrp1.dejanews.com>

I need to be able to write to a file who is owned by root via web server
(apache) running as apache. Can someone lead me in the right direction or
point me where i can get good documentation on that.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


------------------------------

Date: Mon, 06 Jul 1998 02:09:02 GMT
From: djgaus@nb.net
Subject: HTML Tables in PERL from SQL query
Message-Id: <6npbjv$cb$1@nnrp1.dejanews.com>

I am pulling images & descriptions out of a SQL database through a query, row
by row and placing them into a table which will be created on the fly with
PERL. The cell properties will differ for each image & description. It will
be a two columned table with multiple rows, most image/description cells will
have colspans and rowspans of 1, however there are some which have colspans
and/or rowspans of 2. I need a script which can take these on the fly and
output them into a table. The problem is if an image comes up on the row
first which has a colspan of 1, and the next one has a colspan of 2, I
wouldn't want an 'empty' cell, I need to somehow hold this cell (in an array
or list or something) till the next row. This would also apply for rowspans
as well.  I am sorry if I am not explaning this very well, basically I just
want a dynamic 2 columned table which will consist of various rowspans &
colspans, without any empty cells, which is being generated through an SQL
query.

Any help would be appreciated....

Thanx,
Jason L.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


------------------------------

Date: Mon, 6 Jul 1998 19:42:55 -0400
From: "David Thompson" <domainsource@usa.net>
Subject: HTTP connections WITHOUT the libwww module?
Message-Id: <6nrn6u$k8b$1@winter.news.erols.com>

Is it possible to retrieve a URL (and store for later parsing) WITHOUT
using the LibWWW module?

Is it possible to just import the useragent functions into a script?
(not my preferred solution, but workable).

Thanks a lot!

David Thompson





------------------------------

Date: 06 Jul 1998 20:06:15 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: "David Thompson" <domainsource@usa.net>
Subject: Re: HTTP connections WITHOUT the libwww module?
Message-Id: <4swuwjug.fsf@mailhost.panix.com>

"David Thompson" <domainsource@usa.net> writes:

> Is it possible to retrieve a URL (and store for later parsing) WITHOUT
> using the LibWWW module?

Well, the libwww module manages somehow.

> Is it possible to just import the useragent functions into a script?
> (not my preferred solution, but workable).

Your best bet would be to examine the libwww source, since it's freely
available.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


------------------------------

Date: 06 Jul 1998 20:11:42 -0400
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
To: domainsource@usa.net
Subject: Re: HTTP connections WITHOUT the libwww module?
Message-Id: <m3ww9q4j0h.fsf@peach.z.org>

"David Thompson" <domainsource@usa.net> writes:

> Is it possible to retrieve a URL (and store for later parsing) WITHOUT
> using the LibWWW module?
> 
> Is it possible to just import the useragent functions into a script?
> (not my preferred solution, but workable).

I'm a bit puzzled.

The useragent [sic] functions are part of the LWP modules. If you
don't use them, you don't use them. If you import the functions into a
script (not sure what you mean), you're using them.

If you're looking to grow your own, I'd suggest picking up a copy of
"Web Client Programming in Perl" by Clinton Wong. It's published by
O'Reilly & Associates.

Hope that helped,

Jeremy
-- 
Jeremy D. Zawodny                   Web Geek, Perl Hacker, etc.
http://www.wcnet.org/~jzawodn/      jzawodn@wcnet.org

LOAD "LINUX",8,1


------------------------------

Date: Mon, 06 Jul 1998 20:30:05 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: HTTP connections WITHOUT the libwww module?
Message-Id: <comdog-ya02408000R0607982030050001@news.panix.com>
Keywords: from just another new york perl hacker

In article <6nrn6u$k8b$1@winter.news.erols.com>, "David Thompson" <domainsource@usa.net> posted:

>Is it possible to retrieve a URL (and store for later parsing) WITHOUT
>using the LibWWW module?

well, the LWP module retreives a URL without the LWP module, so
it must be possible ;)

just open a socket and do the HTTP stuff like any other client/server
app.  look at Socket.pm or IO::Socket.  [NB: not for the timid]

>Is it possible to just import the useragent functions into a script?
>(not my preferred solution, but workable).

well, if you are using the UserAgent stuff, you're using LWP, which
you didn't wnat to use.

perhaps this isn't the problem though.  why can't you use LWP?

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers Travel Deals! <URL:http://www.pm.org/travel.html>


------------------------------

Date: 2 Jul 1998 22:54:23 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: I NEED SOME HELP
Message-Id: <6nh32v$n76$2@comdyn.comdyn.com.au>


Please read the following information on how to choose a good subject
line:

http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post

In article <6ned7n$b6e$1@supernews.com>,
	"David" <dcunningham@detnet.com> writes:
> Hi all!  I know this may sound pretty clueless, but I'm running IIS 3.0 and
> NT 4, and have perl5 installed properly ( I think), but I don't understand

You think? That really isn't enough. You need to be sure. Do perl
programs run?

> how to run the perl scripts from the web.  I am basically trying to create

You don't run perl scripts from the web. You might access a server
which starts up some CGI process that might just happen to be a perl
script.

> forms for different Web uses.  I understand that the script is going to
> process the form info., but I don't understand how to integrate the html

Is going to? Only if you make it. And that is not even really true.
The user agent will pass certain things to the server as specified by
the CGI protocol. The server will then make these certain things
available to the CGI program as environment variables and/or standard
input. The CGI program has no clue whether this stuff came from a form,
or was provided by the user agent itself, or even by the server.

> with the perl.  If someone can help me, I realize it may take awhile, but I
> would appreciate it.  My ICQ # is 2356968 and my email address is
> wbj1@cornell.edu.

ICQ? What's that? Hasn't that been bought by AOL? And you left out
your credit card details. I might have emailed you if you hadn't :)

You don't ask a question in the above.

1) To learn about setting up your web server to execute CGI programs,
refer to the documentation of your server. If you have questions about
CGI or your web server, ask on an appropriate group.

2) Once you are certain that your web server is set up correctly, and
that it executes CGI programs, you can proceed to write your CGI
programs in perl. A good start would be to read up on the CGI.pm
module, which should come with every recent version of perl.

3) If you, at some point during the prorgamming phase, run into
specific _perl_ problems, come back, and ask us. We might then
actually be able to help.

4) also read: 

Perl CGI FAQ and (no offense) Idiot's guide:

http://www.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html
http://www.perl.com/CPAN/doc/FAQs/cgi/perl-cgi-faq.html

Section 9 of the perl FAQ:

# perldoc perlfaq9

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Unix is user friendly. It's just
Commercial Dynamics Pty. Ltd.       | selective about it's friends.
NSW, Australia                      | 


------------------------------

Date: 06 Jul 1998 11:26:52 -0400
From: wescott@cygnus.ColumbiaSC.NCR.COM (Mike Wescott)
Subject: Re: i've got a forking problem
Message-Id: <x43ecf6lvn.fsf@cygnus.ColumbiaSC.NCR.COM>

In article <359CB1F2.2F1C@aspentech.com> Ian Boys <boys@aspentech.com> writes:

>>>> :    while (<F>) {
>>>> :        fork && next;
>>>> :        print;
>>>> :        exit;
>>>> :    }
>>>>

> In the code example, all reading from the input file is done in
> the parent process. Duplication of input buffers and sharing of 
> seek pointers with the children should not be an issue. Granted,
> the lines may be printed in a non-deterministic order, but one
> assumes that is not an issue.

Correct, that's not an issue.

> The parent process reads a line from the file and stores it in $_.
> The child is forked, producing a copy of $_ in the child as it then 
> was in the parent.  The child prints its private copy of $_ and exits.
> Where is the problem?

As part of the exit process fclose() gets called on open filehandles
which, in turn, calls fflush.

>From the man page on fclose (a SysV version):

     When fflush() is called on a  stream opened for reading, any
     unread  data  buffered  in  the stream is invalidated.  When
     fflush() is called on a stream opened for  reading,  if  the
     file  is  not already at EOF, and the file is one capable of
     seeking,  the  file  offset  of  the  underlying  open  file
     descriptor  is  adjusted  so the next  operation on the open
     file description deals with the byte  after  the  last  byte
     read from or written to the stream being flushed.

So the anomalous behavior is related to the implementation of fflush
and fclose.

This behavior may be undesirable in this scenario, but in a
fork/exec/wait scenario it leaves the underlying shared file pointer
exactly where one would want.

-- 
	-Mike Wescott
	 mike.wescott@ColumbiaSC.NCR.COM


------------------------------

Date: Mon, 6 Jul 1998 15:22:22 -0700
From: "Erik" <erik@zeno.com>
Subject: inetinfo sticks in NT
Message-Id: <6nrijr$stt$1@nntp1.ni.net>

Whenever I do stupid things like forgetting to increment i in a loop... like
this...

while ($i < 10) {
     print "this loop should run 10 times if I remember to increment i";
}

$i++ # Doh!  Shoulda done this in the loop.

Like that... my task manager shows the task "inetinfo" using 100% resources,
and I cannot end-task it.  I am forced against every fiber of my being to
reboot completely, which makes me insane.  I've tried using the NT ResKit
Process Viewer to get inside the inetinfo into it's
sub-processes/threads/whatever to shut it down there, but I can't do it.

Anyone?

Erik




------------------------------

Date: Mon, 6 Jul 1998 16:21:26 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: inetinfo sticks in NT
Message-Id: <MPG.100afbd53e7eee709896eb@nntp.hpl.hp.com>

In article <6nrijr$stt$1@nntp1.ni.net> on Mon, 6 Jul 1998 15:22:22 -0700, 
Erik <erik@zeno.com> says...
> Whenever I do stupid things like forgetting to increment i in a loop... like
> this...
> 
> while ($i < 10) {
>      print "this loop should run 10 times if I remember to increment i";
> }
> 
> $i++ # Doh!  Shoulda done this in the loop.
> 
> Like that... my task manager shows the task "inetinfo" using 100% resources,
> and I cannot end-task it.  I am forced against every fiber of my being to
> reboot completely, which makes me insane.  I've tried using the NT ResKit
> Process Viewer to get inside the inetinfo into it's
> sub-processes/threads/whatever to shut it down there, but I can't do it.
> 
> Anyone?

And your Perl question is ...?

-- 
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: 6 Jul 1998 23:25:19 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: inetinfo sticks in NT
Message-Id: <6nrmcv$h8b$3@comdyn.comdyn.com.au>

In article <6nrijr$stt$1@nntp1.ni.net>,
	"Erik" <erik@zeno.com> writes:

> Like that... my task manager shows the task "inetinfo" using 100% resources,
> and I cannot end-task it.  I am forced against every fiber of my being to
> reboot completely, which makes me insane.  I've tried using the NT ResKit
> Process Viewer to get inside the inetinfo into it's
> sub-processes/threads/whatever to shut it down there, but I can't do it.

And what does this have to do with perl? This is clearly an operating
system deficiency, which you should take up with the vendor of your
operating system. It also has to do with the mouse driven clickme
interface that people get addicted to. If you start your perl program
from the command line, you can just stop it by using whatever your
shell has configured as a break key. probably ctrl-C or something like
that. No need for a 'task manager'.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Make it idiot proof and someone will
Commercial Dynamics Pty. Ltd.       | make a better idiot.
NSW, Australia                      | 


------------------------------

Date: 06 Jul 1998 20:09:07 -0400
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
To: erik@zeno.com
Subject: Re: inetinfo sticks in NT
Message-Id: <m31zry5xp8.fsf@peach.z.org>

"Erik" <erik@zeno.com> writes:

> Like that... my task manager shows the task "inetinfo" using 100% resources,
> and I cannot end-task it.  I am forced against every fiber of my being to
> reboot completely, which makes me insane.  I've tried using the NT ResKit
> Process Viewer to get inside the inetinfo into it's
> sub-processes/threads/whatever to shut it down there, but I can't do it.
> 
> Anyone?

C:\> kill inetinfo
C:\> net start w3svc

"kill" is in the resource kill. It does the NT version of a Unix
"kill -9".

Ask in the right newgroup next time...

Jeremy
-- 
Jeremy D. Zawodny                   Web Geek, Perl Hacker, etc.
http://www.wcnet.org/~jzawodn/      jzawodn@wcnet.org

LOAD "LINUX",8,1


------------------------------

Date: Mon, 06 Jul 1998 05:33:35 +0100
From: Rao <rao_madhavrao@bmc.com>
Subject: invoking java from a cgi script.
Message-Id: <35A0539F.4DC1@bmc.com>

passme

I have a perl cgi script, in which I am trying to execute a java program
using "exec" or "system" command. The cgi script runs from a unix
command line, but the browser ignores the exec or system command. 
Example code is provided below:

example.cgi
----------
#!/sww/bin/perl
system "java javaCode" ; # `exec java javaCode` fails as well

print "HTTP/1.0 200 OK";
print sprintf("Content-type: text/html%c%c", 10, 10);
print "<HTML> <BODY ALIGN=CENTER>\n";
 ......
 ......
print "</BODY> </HTML>\n"

Any help in making this work from the browser will be greatly
appreciated.


------------------------------

Date: 6 Jul 1998 04:53:01 GMT
From: kortbein@iastate.edu (Josh Kortbein)
Subject: Re: invoking java from a cgi script.
Message-Id: <6npl7d$h4i$1@news.iastate.edu>

Rao (rao_madhavrao@bmc.com) wrote:
: passme

: I have a perl cgi script, in which I am trying to execute a java program
: using "exec" or "system" command. The cgi script runs from a unix
: command line, but the browser ignores the exec or system command. 
: Example code is provided below:

: example.cgi
: ----------
: #!/sww/bin/perl
: system "java javaCode" ; # `exec java javaCode` fails as well

I don't think you would want exec() anyway, if you want to print
out some HTML afterward; exec() runs its arguments, and never returns.

As to why system() doesn't seem to do anything:

	/home/kortbein% perldoc -f system
	=item system LIST

	Does exactly the same thing as "exec LIST" except that a fork is done
	first, and the parent process waits for the child process to complete.
	Note that argument processing varies depending on the number of
	arguments.  The return value is the exit status of the program as
	returned by the wait() call.  To get the actual exit value divide by
	256.  See also L</exec>.  This is I<NOT> what you want to use to capture
	the output from a command, for that you should use merely backticks or
	qx//, as described in L<perlop/"`STRING`">.

Have you checked the return value from system()? Maybe it's not working
because it really isn't...


Josh

--

__________________________________________
She had heard all about excluded middles;
they were bad shit, to be avoided.
            - Thomas Pynchon



------------------------------

Date: 6 Jul 1998 23:11:40 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: invoking java from a cgi script.
Message-Id: <6nrljc$h8b$1@comdyn.comdyn.com.au>

In article <35A0539F.4DC1@bmc.com>,
	Rao <rao_madhavrao@bmc.com> writes:
> passme

what does this mean, anyway?

> I have a perl cgi script, in which I am trying to execute a java program
> using "exec" or "system" command. The cgi script runs from a unix

exec and system are not equivalent, but I guess you know that.

> command line, but the browser ignores the exec or system command. 

Of course the browser ignores it. The browser never even sees the code.
This is a CGI, right?

> #!/sww/bin/perl
> system "java javaCode" ; # `exec java javaCode` fails as well

Maybe you should check the return status of system, just to find out
what went wrong.

Since this is running as a CGI or so, you are aware that this is
actually running in a totally different environment that your shell?

# perldoc -f system.

> print "HTTP/1.0 200 OK";

Why are you printing this header? Never mind. I don't want to know.

> print sprintf("Content-type: text/html%c%c", 10, 10);

And this is wrong, or at least silly.

print "Content-type: text/html\n\n";

will work just as well, but if you want to be fully correct, you will
have to end your line in CRLF (13 10), as specified in RFC 1945.

And why the sprintf, when printf will do the same?


Please also read the following:

Perl CGI FAQ and (no offense) Idiot's guide:

http://www.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html
http://www.perl.com/CPAN/doc/FAQs/cgi/perl-cgi-faq.html

Section 9 of the perl FAQ:

# perldoc perlfaq9

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | That's not a lie, it's a
Commercial Dynamics Pty. Ltd.       | terminological inexactitude.
NSW, Australia                      | 


------------------------------

Date: Mon, 06 Jul 1998 23:29:49 GMT
From: mgscheue@io.com
Subject: Re: invoking java from a cgi script.
Message-Id: <6nrmlc$cvm$1@nnrp1.dejanews.com>

In article <35A0539F.4DC1@bmc.com>,
  rao_madhavrao@bmc.com wrote:
> I have a perl cgi script, in which I am trying to execute a java program
> using "exec" or "system" command. The cgi script runs from a unix
> command line, but the browser ignores the exec or system command.

Hint:  it's not the browser that's doing the "exec" or "system"--it's the web
server.

Mark

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


------------------------------

Date: Mon, 06 Jul 1998 18:08:18 GMT
From: 4newsargus@mail.entrsft.com (David Rouse)
Subject: Re: Is Perl through CGI enough for this?
Message-Id: <4newsargus-0607981409040001@192.36.36.47>

In article <359D8A4A.A997DB4F@fccj.org>, sneex@fccj.org wrote:


> Not wanting to state the obvious, but Perl is ONLY as good as your best
>programmer.
>

Thanks to all those who replied to my question. To make a long story
short, all those who replied seemed to think that Perl is more than up to
the task of a web based front end for a ads manifesting database.

So now I'm back to "Learning Perl" and lurking ...

David Rouse


------------------------------

Date: 6 Jul 1998 03:35:29 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Length and stripping function
Message-Id: <6npgm1$bra$1@comdyn.comdyn.com.au>

In article <3EBn1.1137$OY1.3633784@nnrp2.ptd.net>,
	"Terry" <terry@aol.com> writes:
> I run an online newsletter, and on the form the value of the only field is
> "put your email here" (due to space consideration)  anyway
> 
> I get people who don't remove that and put their email before it and submits

Maybe you shouldn't put it in the box, but next to it.

> me their email which a PERL scripts automatically stres into a text file.
> 
> What I want to do is find a way to strip that line if it is there.

s/put your email here//;

> open(LIST,">>$list_file");

You really should test the return value of open, to see if it succeeded:

open(LIST,">>$list_file") || die "Couldn't open $list_file for append: $!";

> terry@tbonnet.com, please don't post to the list just incase I don't get
> back here for a while.  thanks

If you don't come back here for a while, then you won't read the
answer. Why do you post here if you don't even plan on checking for
the answer here? We are _not_ a personal help desk. You're being rude.
You ask people to take the time to answer your question, but you don't
plan on putting in the least amount of effort to get the answer. You
also don't want anyone else to see the answer to your problem.

Demise of the Internet.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | 
Commercial Dynamics Pty. Ltd.       | What's another word for Thesaurus?
NSW, Australia                      | 


------------------------------

Date: Mon, 06 Jul 1998 11:07:47 -0500
From: Palisade Corporation <admin@palisade.com>
Subject: Re: limits of glob() ? and number of sub-dirs in win95
Message-Id: <35A0F653.D9636610@palisade.com>

Dan Baker wrote:
> 
> can anyone expound just a little more on the limitations of using glob()
> on win95 to grab a directory listing? are there limits on how many
> sub-dirs can exist in a dir in win95?
> 

@fileList = glob "*/*";
print "$#fileList";

from the root of my D: drive tells (111) me I have 112 files/
directories.  There are over 3,000.  This on NT 4.0 (ntfs).

-- 
Palisade Corporation Email/Web Administrator
admin@palisade.com

For information on contacting Palisade Corporation
send email to info@palisade.com


------------------------------

Date: Mon, 06 Jul 1998 13:25:00 -0400
From: Dennis Kowalski <dennis.kowalski@daytonoh.ncr.com>
Subject: Re: limits of glob() ? and number of sub-dirs in win95
Message-Id: <35A1086C.37DD@daytonoh.ncr.com>

Palisade Corporation wrote:
> 
> Dan Baker wrote:
> >
> > can anyone expound just a little more on the limitations of using glob()
> > on win95 to grab a directory listing? are there limits on how many
> > sub-dirs can exist in a dir in win95?
> >
> 
> @fileList = glob "*/*";
> print "$#fileList";
> 
> from the root of my D: drive tells (111) me I have 112 files/
> directories.  There are over 3,000.  This on NT 4.0 (ntfs).
> 
> --
> Palisade Corporation Email/Web Administrator
> admin@palisade.com
> 
> For information on contacting Palisade Corporation
> send email to info@palisade.com

I think glob is giving you the files in your current directory.

To traverse a whole tree, use find (File::Find)


------------------------------

Date: Mon, 06 Jul 1998 12:09:36 -0500
From: Dan Baker <dtbaker_@flash.net>
Subject: Re: limits of glob() ? and number of sub-dirs in win95
Message-Id: <35A104D0.6AAB@flash.net>

Palisade Corporation wrote:
> 
> Dan Baker wrote:
> >
> > can anyone expound just a little more on the limitations of using glob()
> > on win95 to grab a directory listing? are there limits on how many
> > sub-dirs can exist in a dir in win95?
> >
> 
> @fileList = glob "*/*";
> print "$#fileList";
> 
> from the root of my D: drive tells (111) me I have 112 files/
> directories.  There are over 3,000.  This on NT 4.0 (ntfs).
-------------------


hhhmmm, well, I did a little test on win95, and it worked fine with
about 5000 files and directories. I stopped there though.... 

by the way, I'm no expert, but unless you did a chdir to a directory you
know has the 3000 files, you probably got an acurate count of the number
of files in the directory where your test.pl is.

Dan



------------------------------

Date: 6 Jul 1998 14:36:39 GMT
From: cpierce1@cp500.fsic.ford.com (Clinton Pierce)
Subject: Re: limits of glob() ?
Message-Id: <6nqndn$4ui2@eccws1.dearborn.ford.com>

In article <359F8BA7.2B3F@flash.net>,
	Dan Baker <dtbaker_@flash.net> writes:
>Tom Christiansen wrote:
>> 
>> The first stop should *always* be grepping the standard docset that's
>> included with every Perl distribution and electronically searchable.
>> The second stop should be some book with Larry's name on it. :-)
>> 
>
>hhhmmm, sounds like sage advice! Now all I have to do is figure out the
>best way to search thru the docs on win32.
>

File::Find and a judicious use of Regular Expressions.  When in a pinch,
roll your own grep(1).  If you haven't bought the Mortice Kern toolset,
this should be the first Win32 program you write... :-)

Best part is, you can put perl into paragraph mode, and make the matches
work even better than grep(1)...


-- 
+------------------------------------------------------------------------+
|  Clinton A. Pierce    |   "If you rush a Miracle Man,   | http://www.  |
|  cpierce1@ford.com    |     you get rotten miracles"    | dcicorp.com/ |
| fubar@ameritech.net   |--Miracle Max, The Princess Bride| ~clintp      |
+------------------------------------------------------------------------+
GCSd-s+:+a-C++UALIS++++P+++L++E---t++X+b+++DI++++G++e+>++h----r+++y+++>y*



------------------------------

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 3069
**************************************

home help back first fref pref prev next nref lref last post