[11114] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4714 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 21 18:06:09 1999

Date: Thu, 21 Jan 99 15:00:23 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 21 Jan 1999     Volume: 8 Number: 4714

Today's topics:
    Re: "News Group Not Found" (Randal L. Schwartz)
    Re: $0 or @ARGV in a one-liner (??) (Martien Verbruggen)
    Re: ancestry of perl features droby@copyright.com
    Re: Automatically Posting forms (Randal L. Schwartz)
    Re: Automatically Posting forms <nospam@my-liquidinformation.net>
    Re: CHOWN problem (Martien Verbruggen)
        encrypting with PGP <hitbyabus@mindspring.com>
    Re: finding dirs with readdir (I R A Aggie)
        Finding if a file exists colin@cinemas-online.co.uk
    Re: How do I define a scalar name with a scalar (Matthew Bafford)
        Html Help <pep_mico@hp.com>
    Re: Looking for free Web Server with CGI <denny.john@btinternet.com>
        Newbie Shopping Cart Question <apoh@sinewave.com>
    Re: Pattern match behaves strangely (I R A Aggie)
    Re: Perl and Java: JPL ??? <nospam@my-liquidinformation.net>
    Re: Perl Criticism (I R A Aggie)
    Re: Perl problem :(Offline mode... <andrewf@beausys.demon.co.uk>
        PERL Security Issues (Nick Smith)
        Perl Workshop <info@itte.org>
    Re: PLease Help CGI configuration problem <bruce.hartley@tivoli.com>
    Re: PLease Help CGI configuration problem <bdeitte@blue.weeg.uiowa.edu>
    Re: PLease Help CGI configuration problem (I R A Aggie)
    Re: problem with a script running on iis/nt (Martin Vorlaender)
        Reading a log file from an HTML Page <hitbyabus@mindspring.com>
    Re: Running a SQL query from a Perl CGI program scott.craig@moh.hnet.bc.ca
    Re: Running a SQL query from a Perl CGI program dhosek@webley.com
        Trying to work with a text database <cpuweb@cpuweb.com>
        Web Hosting Company Is Requestion Programmers <hitbyabus@mindspring.com>
    Re: writing to files <cpuweb@cpuweb.com>
    Re: writing to files (J Holden)
    Re: Y2K? (Abigail)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 21 Jan 1999 14:26:51 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: "News Group Not Found"
Message-Id: <m1pv88mfdg.fsf@halfdome.holdit.com>

>>>>> "KernelKlink" == KernelKlink  <KernelKlink@webtv.net> writes:

KernelKlink> I just now found out that the Newsgroup search tool built
KernelKlink> into Webtv only returns SOME newsgroups. Type "Microsoft"
KernelKlink> into the widget and the results come back so fast and
KernelKlink> plentiful that it will knock my tv onto the floor, but
KernelKlink> type in for example NetObjects (and others) and you get
KernelKlink> "News Groups Not Found". Newsgroup comes back "Not Found"
KernelKlink> even if I type in the direct address to it.

I've never heard of "NetObjects", but I went to Dejanews with the
"interest finder" to find the newsgroups that deal with this term.
Strange as it may seem, they all belong to a private hierarchy called
"netobject.*".  As this is a private hierarchy, not one of the big 8
or regionals, the chances of finding it on a random ISP will vary
wildly.

If Microsoft has chosen not to carry the "netobjects.*" hierarchy on
the WebTv servers, that's their choice.  If they delete it from one of
the big 8 (like comp.netobjects.*), *then* you can raise a flag.  So,
if you want to talk about NetObjects (is that a [tm]? :-), get a
mainstream group created -- then it'll be everywhere.

print "Just another Perl hacker,"

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Thu, 21 Jan 1999 22:16:26 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: $0 or @ARGV in a one-liner (??)
Message-Id: <_GNp2.15$CB1.1910@nsw.nnrp.telstra.net>

In article <7864sf$ls8$2@client2.news.psi.net>,
	abigail@fnx.com (Abigail) writes:
> Martien Verbruggen (mgjv@comdyn.com.au) wrote on MCMLXVIII September
> MCMXCIII in <URL:news:6Wtp2.58$Rq1.4085@nsw.nnrp.telstra.net>:
> %% 
> %% 	Why is the -e flag passed on in @ARGV?

> What -e?

My mistake. As Uri pointed out, $0 is set to -e for these one-liners.
Nothing happens to @ARGV.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | A Freudian slip is when you say one
Commercial Dynamics Pty. Ltd.       | thing but mean your mother.
NSW, Australia                      | 


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

Date: Thu, 21 Jan 1999 21:41:37 GMT
From: droby@copyright.com
Subject: Re: ancestry of perl features
Message-Id: <7886uf$abo$1@nnrp1.dejanews.com>

In article <MPG.111027517359d2ef9899b2@nntp.hpl.hp.com>,
  lr@hpl.hp.com (Larry Rosler) wrote:
> >
> > math infix ops (+, *, /, etc)		C
>
> (from B, from BCPL, from Algol60, from Fortran, from time immemorial?)
>

Yes.  Fortran is time immemorial.  1954 or so...

> >
> > flow control (for, while, etc)		C
>
> (from B, at least)
>

It was around in Algol in pretty similar form.  Some of the syntax changed of
course.

>
> compund statements {...} from C, from B, ...
>

The compound statement as a concept I think started with Algol.  Of course,
they used BEGIN ... END instead of {...}.  I don't know whether it was in
Algol-60 or arrived in 68.


> What happened to function definitions and invocations, and to classes
> and various OOP stuff?
>

Now you're getting into RECENT history ;-)

Pardon me, I just realized I'm older than Fortran.

Sob.

--
Don Roby

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 21 Jan 1999 14:29:01 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Automatically Posting forms
Message-Id: <m1lniwmf9u.fsf@halfdome.holdit.com>

>>>>> "Justin" == Justin M Silver <jsilver@multisoft.com> writes:

Justin> I am trying to get a script which parses a file, assigns
Justin> variables to the data, and then assignes these variables to
Justin> hidden fields automatically post these hidden fields to the
Justin> next script. I have been successful in writing the script, but
Justin> you still have to click [Submit] to post to the next script.
Justin> Is it possible to get it do this automatically (kind of lika a
Justin> meta refresh)? Any help would be appreciated.

$ perl -MCPAN -e'install LWP'
$ perldoc lwpcook
$ perl -e 'print "Just another Perl hacker,"'

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: 21 Jan 99 22:29:20 GMT
From: Aamir Sehbai @ Liquid Information <nospam@my-liquidinformation.net>
Subject: Re: Automatically Posting forms
Message-Id: <916957760210@liquidinformation.net>

X-Compliants: newsgroups@liquidinformation.net
I'm pretty sure libwww can do what you're looking for. Check out
http://www.linpro.no/lwp/
 
Justin M. Silver  <jsilver@multisoft.com> wrote:
>I am trying to get a script which parses a file, assigns variables to the
>data, and then assignes these variables to hidden fields automatically post
>these hidden fields to the next script. I have been successful in writing
>the script, but you still have to click [Submit] to post to the next
script. >Is it possible to get it do this automatically (kind of lika a meta
>refresh)? Any help would be appreciated.
>
>Justin Silver
>
>--
>--------------------------------------------------------
>MultiSoft Incorporated         Phone: 770-612-8411 X1417
>http://www.multisoft.com       Pager: 404-743-7488
>Email: jsilver@multisoft.com   Fax:   770-612-1978
>--------------------------------------------------------
  
 
-- 
A Liquid Information Message
Get free, Advanced Web Based Email & Newsgroup Access at:
http://www.liquidinformation.net
--



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

Date: Thu, 21 Jan 1999 22:13:38 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: CHOWN problem
Message-Id: <mENp2.13$CB1.1910@nsw.nnrp.telstra.net>

In article <aqc687.v2p.ln@magna.metronet.com>,
	tadmc@metronet.com (Tad McClellan) writes:

>       chown myusername, <*.shtml>;  # don't need a temp variable either

Just for the sake of clarity: The bareword myusername above suggests
that the user name can be supplied as a string scalar to chown. It
can't. chown expects both a numerical uid and gid (group id).

Replace myusername with $uid, $gid, and it works. Of course, it is a
wise thing to check for succes:

# get $uid and $gid with getpwnam

my @filenames = <*.html>; # prefer opendir, readdir
my $changed = chown $uid, $gid, @filenames;
warn "Didn't successfully chown all files" unless ($changed == @filenames);

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | That's funny, that plane's dustin'
Commercial Dynamics Pty. Ltd.       | crops where there ain't no crops.
NSW, Australia                      | 


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

Date: Thu, 21 Jan 1999 17:30:13 -0500
From: "Brian Thompson" <hitbyabus@mindspring.com>
Subject: encrypting with PGP
Message-Id: <7889t6$1rq$1@camel18.mindspring.com>

does anyone know where I can get PGP for *nix?

Also, do you know the command line for encrypting data written to a log file
from a .cgi script?

Thanks
Brian Thompson
Create-a-Web Hosting & Design
www.createaweb.com





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

Date: Thu, 21 Jan 1999 16:30:38 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: finding dirs with readdir
Message-Id: <fl_aggie-2101991630380001@aggie.coaps.fsu.edu>

In article <36A78F9B.2C082017@sgi.com>, bgilbert@sgi.com wrote:

Looks fine to me. When I add:

+ closedir (DIR);
print "Images: $#img\tDirs: $#dir\n";

I get:

Images: 3       Dirs: 145

Details:

<selected> uname -a => IRIX64 6.2 IP19
Perl version: 5.004_04

I dunno. Everything *should* work.

James


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

Date: Thu, 21 Jan 1999 22:25:53 GMT
From: colin@cinemas-online.co.uk
Subject: Finding if a file exists
Message-Id: <7889h4$cm3$1@nnrp1.dejanews.com>

Hi all,

I'm writing a perl script (running as an SSI under unix) to use HTTP_REFERER
[if it exists] and tries to find a file with the filename as the file,

i.e. if HTTP_REFERER comes back with the filename of foobar.html then the
filename that is used will be foobar.dbf.

 The question is how do I check that this file exists, and if not open another
file instead of it !

 speed is of the essence over memory usage.  as I have put the error condition
that if HTTP_REFERER come back as a NULL string


Thanks in advance

Colin Bell
p.s. please cc answers to my e-mail address as well as posting here!

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Thu, 21 Jan 1999 22:00:31 GMT
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: How do I define a scalar name with a scalar
Message-Id: <slrn7af8ll.fk.dragons@Server.Network>

On Thu, 21 Jan 1999 15:21:48 -0600, in article <<7885tb$2ur$1@news.ipa.net>>,
Matt Johnson <cpuweb@cpuweb.com> wrote:
=> In my program I am wanting to use a scalar as part of the name for another
=> scalar.
[snip]

No, you aren't.  You just think you are.

Your best bet is to use a hash, that way you can do:

my %special = (
	'1'    => 'Have a nice day',
	'long' => 'Have a long beard'
);

my $varname;

$varname = '1';
print "$special{$varname}\n";

$varname = 'long';
print "$special{$varname}\n";


If you insist on doing it your way, look into soft references and/or the
(not recomended) eval.

HTH!

--Matthew



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

Date: Thu, 21 Jan 1999 23:16:54 +0100
From: Pep Mico <pep_mico@hp.com>
Subject: Html Help
Message-Id: <36A7A756.E4102C57@hp.com>

Does anybody converted HTML help pages of Activestate Perl in a compiled
Microsoft HTML help?

And if exist, where can I get it?

Best Regards
pep_mico@hp.com




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

Date: Thu, 21 Jan 1999 22:41:55 -0000
From: "Denny John" <denny.john@btinternet.com>
Subject: Re: Looking for free Web Server with CGI
Message-Id: <788aak$5hs$1@uranium.btinternet.com>

Have you tried the pws (personal web server) that comes with your win98 cd -
theres a pws directory in the misc directory I think. Its seems to be pretty
good.


Steen Angelo wrote in message <36A79514.C9794DB4@acsoft.dk>...
>Hi there.
>
>In my search for the same, someone (in a newsgroup) suggested PI3 Webserver
>located at http://www.johnroy.com/
>
>Have a go, and try for yourself ;-)
>
>Best regards
>
>Steen Angelo
>
>
>(if you eat a meal of pasta, and then afterwards have a meal antipasta, are
>you then  hungry again?)
>
>Stefan Mueller wrote:
>
>> Chris wrote:
>> >
>> > Hi
>> >
>> > Are there any free Web servers for Win98 (even trial versions) that
>> > allow me to mess around with CGI & Perl? Last time I tried this (years
>> > ago), PWS was supposed to do it but it was broken (or I was broken, or
>> > something)
>>
>> Try apache. There're binaries available on www.apache.org
>> And get perl from www.activestate.com.
>>
>> It works fine for me.
>>
>> Stefan.
>>
>>
>> --------------------------------------------
>> Dipl.-Ing. Stefan Mueller
>> Ruhr-University Bochum
>> AG f. num. Meth. i.d. Mechanik und
>>   Simulationstechnik
>> Germany
>> --------------------------------------------
>




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

Date: Thu, 21 Jan 1999 14:32:46 -0800
From: Andrew Pohlman <apoh@sinewave.com>
Subject: Newbie Shopping Cart Question
Message-Id: <36A7AB0D.67E86E93@sinewave.com>

I have written a lot of PERL code but all of it pretty simple, mainly
performing flat file DB operations and maintenance.  I'd like to get
real and interface a shopping cart with a SQL database.  I have heard
there are many shopping cart programs available for free download.  Can
someone recommend one that is a good match with PERL (whether or not I
have to buy it).

Thanks in advance!!



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

Date: Thu, 21 Jan 1999 16:34:16 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Pattern match behaves strangely
Message-Id: <fl_aggie-2101991634160001@aggie.coaps.fsu.edu>

In article <36a77505.175090106@news.shreve.net>, no.richro.spam@acm.org
(Richard Rowell) wrote:

+ This prints YUP for some reason.  I thought that \s* would only match
+ spaces, \t,\n,\r, and \f (whatever \r, and \f are).

Well, not entirely. The '*' means 'match 0 or more times'. Well, how many
times is \s* going to match? every time, since it should match 0 occurances.

What you want (I think) is \s+, or perhaps \s+?

James


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

Date: 21 Jan 99 22:23:52 GMT
From: Aamir Sehbai @ Liquid Information <nospam@my-liquidinformation.net>
Subject: Re: Perl and Java: JPL ???
Message-Id: <916957432908@liquidinformation.net>

X-Compliants: newsgroups@liquidinformation.net
I downloaded the latest build of Perl just to check out JPL (Java Perl
Lingo), because the concept seems so evidently cool and useful. But I am
sad to report that I found the syntax of JPL ugly when compared to pure
Perl OR pure Java.
 
Maybe, Perl's functionality should be made availbale to Java by creating a
Perl class library (perl.jar) that can be imported into any Java program,
by "import perl.*;" or something similar ?
 
Also, there's been the news on Perl.com about JPL going Open-Source for a
couple of months now, but I have been unable to find any web-site similar
to Mozilla.org, where I can download the newest builds or contribute.
 
  
 
-- 
A Liquid Information Message
Get free, Advanced Web Based Email & Newsgroup Access at:
http://www.liquidinformation.net
--



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

Date: Thu, 21 Jan 1999 17:41:55 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Perl Criticism
Message-Id: <fl_aggie-2101991741550001@aggie.coaps.fsu.edu>

In article <787psa$tq1$1@nnrp1.dejanews.com>, droby@copyright.com wrote:

+ In article <fl_aggie-2001991000310001@aggie.coaps.fsu.edu>,
+   fl_aggie@thepentagon.com (I R A Aggie) wrote:

+ > I see...topmind is here to protect us from ourselves. Before long, he'll be
+ > working for the government, certifying programmers and languages that they
+ > comply with new government regulations.

+ Oh, my!  D'ya suppose he might have had something to do with GOSIP?

I'm about to betray my ignerence, but what is GOSIP, other than the obvious
non-acronym, lowercase version?

James


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

Date: Thu, 21 Jan 1999 22:48:07 +0000
From: Andrew Fry <andrewf@beausys.demon.co.uk>
Subject: Re: Perl problem :(Offline mode...
Message-Id: <Vsf6eLAn66p2EwIu@beausys.demon.co.uk>

In article <qm7687.feo.ln@magna.metronet.com>, Tad McClellan
<tadmc@metronet.com> writes
>
>: Furthermore, it isnt reading documents per se that keeps my company
>: in business. One can only spend so much time reading documentation!
>
>   We are not here to help you keep your company in business.

I am not saying, nor did I imply, that you are. It is an absurd
suggestion, and, frankly, I am surprised that you interpreted my
comments as in any way suggesting this!
I was talking about how it is important for me, as company director,
to use my time wisely ... and how I have only a limited amount of
time to plough through Perl on-line docs.

>   Asking us to read them for you is awfully pretentious.

Again, nonsense. I wasnt asking anyone to read documents for me.
This newsgroup is supposed to be for people to ask questions re.
the Perl language. OK, so am a Perl novice ... but I posed a
simple (?) question, hoping that I might get a quick, simple and
helpful response. One or two were.
I appreciate that many of you are Perl 'experts', but the attitude
of a number of you seems to be... "I cant be bothered with these dumb
questions from Perl newbies. Why cant they read the manuals like
I had to do ? I am interested in the advanced stuff! I am not going
to waste my time on this dumb question ... instead, I'll waste my
time telling him to go read the manuals!".
If this is your only reply, then why bother making one at all ?????
You might as well just change the auto-answer message that gets sent
when one first subscribes to this newsgroup to read something along
the lines of...
"This newsgroup is for the discussion of issues re. the Perl language.
 Please note that you must NOT post a query unless you have first...
 a) read all the Perl documentation
 b) searched the Perl modules
 c) determined that neither the documentation or code answer your query
 When posting a query, you must give an undertaking that you have done
 all the above. Failure to do so may result in unhelpful or sarcastic
 remarks from the experts in the group, who have better things to do
 with their time."

>   It is to discuss interesting Perl problems.

What is interesting to one person (eg a newbie) isnt necessarily
interesting to another (eg an expert). Who are you (or I) to dictate
what constitutes "interesting" ?

>   Discussing problems that have already been solved is not interesting.

Well, perhaps then you should confine this newsgroup to you experts to
discuss the few "interesting" issues that remain (and aren't described
in
on-line documentation anywhere).

>   Too much non-interesting stuff, and people stop reading the
>   newsgroup.

See above remarks. There will always be a mix of interesting and
less interesting stuff.

>   Then you can probably be sure that your postings to the ISO, ITU
>   RFC, Unix, NT newsgroups will be interesting to the readers
>   of those newsgroups.
>
>   But we're not talking about those newsgroups.

I hope my replies have been informative and useful and interesting.
I myself have never replied to a query just to say "Go away and
read the manuals and stop wasting our time!". I dont see the point
in it. If its a dumb question, I try to provide some enlightenment
or (if its really dumb!) I will ignore it.

>   Because we don't want you driving away the knowledgeable folks,
>   we may need them someday?

Why would I need somebody whose only response was "Go away and
read the manuals!" ?

OK, I have no more to say on this. I would just ask that those of
you who find my queries uninteresting or dumb to ignore them,
OK ? I'll get around to reading the on-line docs in my own time,
but I dont appreciate a response which does nothing other than to
tell me to go off and read them.

---
Andrew Fry
"Time flies like an arrow. Fruit flies like a banana". (Groucho Marx).


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

Date: Thu, 21 Jan 1999 22:01:17 GMT
From: nick.smith@team.xtra.co.nz (Nick Smith)
Subject: PERL Security Issues
Message-Id: <36a7a340.94710905@news.xtra.co.nz>

Dear PERlers,

	I am preparing a document that relates to the security issues
pertaining to hosting PERL enabled websites on a webserver. Could any
of you either email me or point me to a reference that contains an
exhaustive guide re: PERL Scripting Security issues?

Thanks in advance
Nick Smith


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

Date: Thu, 21 Jan 1999 22:36:53 GMT
From: "ITTE" <info@itte.org>
Subject: Perl Workshop
Message-Id: <01be458e$8d621300$aa7de8d0@debhome>

Accelerated Perl Programming Workshop
January 28-29, 1999
San Jose, CA

Tuition $849; Group Rates:  Register 3 from the same company; 3rd
registrant attends complimentary.

For more information send an e-mail: info@itte.org
visit: http://www.itte.org/INFO/ptrain.html

About this Workshop:
This hands-on accelerated technical training is accomplishment-oriented
providing attendees with real-life examples. The workshop teaches the
foundations of Perl programming through a series of case studies and
practical examples. Upon completion of the workshop, attendees will be able
to write Perl programs of their own.  

Attendees will construct a realistic data processing package for a
business. The essential components of the language are introduced as they
are used for data management, entry, and reporting. No other Perl class (to
our knowledge) covers this  much material in such a brief time. 

Who Should Attend:
This course is for programmers who want to add Perl to their repertory of
languages. System and network administrators, application programmers,
authors of Web forms and advanced Web applications, Web masters, Web
developers and planners, and client-server developers. Experience
programming in other languages is assumed.

Past Attendee Comments:
"Very knowledgeable instructor!"
"The exercises were very good at illustrating the concepts."
"I liked that the instructor was flexible to the class needs and wants."
"Instructor's enthusiasm, knowledge and communication skills were high."
"Entertaining, enthusiastic, creative, great analogies, and an expert on
Perl."
"Great learning experience."








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

Date: Thu, 21 Jan 1999 16:59:02 -0600
From: Bruce Hartley - TPS Consultant <bruce.hartley@tivoli.com>
Subject: Re: PLease Help CGI configuration problem
Message-Id: <36A7B136.C2DF9959@tivoli.com>

It seems everything I am trying gives me this sort of error. here is some example
code I just tryied. I know this is different but still is confusing me.

It gives me the error/warming:
(offline mode: enter name=value pairs on standard input)

#!/usr/local/bin/perl -w

use CGI;
$cgi = new CGI;
print $cgi->header;
print $cgi->start_html("Simple CGI.pm Program");
print "<H1>Simple CGI.pm Program</H1>\n";
print "<HR >";
print "Here is a list of the values you passed: ";
print $cgi->dump;
exit(0);

thanks,

Bruce

I R A Aggie wrote:

> In article <787qbi$pm7$1@camel15.mindspring.com>,
> <bsh@mindspring.com@mindspring.com@mindspring.com> wrote:
>
> + Thanks for coming this far.
> +
> + I am a newbe when it comes to html, I installed perl5.004 on my spark 5 with
> + the CGI modules. I am now getting a screen waiting with the message:
> +
> + (waitinig for HTTP query from standard output)
>
> Ummm...what are you doing to get this?
>
> James



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

Date: Thu, 21 Jan 1999 16:22:12 -0600
From: Brian Deitte <bdeitte@blue.weeg.uiowa.edu>
Subject: Re: PLease Help CGI configuration problem
Message-Id: <Pine.A41.3.95.990121162001.23696A-100000@black.weeg.uiowa.edu>

perl -no_debug program_name.cgi

(Although that'll just help you win the world's-most-useless CGI.pm
program contest, since no values are passed.  Alternatively you could read
the CGI.pm documentation.)

On Thu, 21 Jan 1999, Bruce Hartley - TPS Consultant wrote:

> It seems everything I am trying gives me this sort of error. here is some example
> code I just tryied. I know this is different but still is confusing me.
> 
> It gives me the error/warming:
> (offline mode: enter name=value pairs on standard input)
> 
> #!/usr/local/bin/perl -w
> 
> use CGI;
> $cgi = new CGI;
> print $cgi->header;
> print $cgi->start_html("Simple CGI.pm Program");
> print "<H1>Simple CGI.pm Program</H1>\n";
> print "<HR >";
> print "Here is a list of the values you passed: ";
> print $cgi->dump;
> exit(0);
> 
> thanks,
> 
> Bruce
> 
> I R A Aggie wrote:
> 
> > In article <787qbi$pm7$1@camel15.mindspring.com>,
> > <bsh@mindspring.com@mindspring.com@mindspring.com> wrote:
> >
> > + Thanks for coming this far.
> > +
> > + I am a newbe when it comes to html, I installed perl5.004 on my spark 5 with
> > + the CGI modules. I am now getting a screen waiting with the message:
> > +
> > + (waitinig for HTTP query from standard output)
> >
> > Ummm...what are you doing to get this?
> >
> > James
> 
> 
> 

-- 
 ...when she smiled, I saw her as the incarnation of meaning.
-Anatole Broyard, Kafka Was the Rage



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

Date: Thu, 21 Jan 1999 17:39:21 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: PLease Help CGI configuration problem
Message-Id: <fl_aggie-2101991739210001@aggie.coaps.fsu.edu>

In article <36A7B136.C2DF9959@tivoli.com>, Bruce Hartley - TPS Consultant
<bruce.hartley@tivoli.com> wrote:

+ It gives me the error/warming:
+ (offline mode: enter name=value pairs on standard input)

Ahah! That's what I thought it was, but I was confuzzled. Here's what you
can do. You run the program and get:

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

Now, type:

color=blue
fruit=orange
flower=rose
<control-d>

Results:

Content-type: text/html

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML><HEAD><TITLE>Simple CGI.pm Program</TITLE>
</HEAD><BODY><H1>Simple CGI.pm Program</H1>
<HR >Here is a list of the values you passed: <UL>
<LI><STRONG>color</STRONG>
<UL>
<LI>blue
</UL>
<LI><STRONG>fruit</STRONG>
<UL>
<LI>orange
</UL>
<LI><STRONG>flower</STRONG>
<UL>
<LI>rose
</UL>
</UL>

This is the great thing about CGI.pm, you can test your CGI programs on
the command-line. Its not perfect -- your environment will not match the
httpd-set environment, for instance, but you can see what's happening.

To run it as a CGI program, tho, you'll need to place it on a web server, 
in the place designated for such program, then point a browser at it.

James


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

Date: Thu, 21 Jan 1999 22:05:10 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: problem with a script running on iis/nt
Message-Id: <36a79686.524144494f47414741@radiogaga.harz.de>

Marc Derriennic (derrienn@bruyeres.cea.fr) wrote:
: I'm trying to obtain the listing of a directory but the pipe is refused,
: the command line is :
:     open (TAB,"dir D:\\wwwroot\\form /b |");
: I recieve an error "Access Refused" that doesn't appear if I remove the "|"
: of course then  the command doesn't work !!!
:
: what can I do ?

1. Use opendir(), readdir(), closedir().

2. Configure IIS to correctly handle I/O redirection:

   IIS 3.0:
   - Insert into the registry
       HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\
       CreateProcessWithNewConsole , contents REG_DWORD 1
   - Restart IIS.

   IIS 4.0:
   - Make sure that you've got Windows Scripting Host installed as part
     of Option Pack 4. You can verify this by looking for the file
     %system32%\cscript.exe. If it isn't there, run setup.exe from
     the Option Pack CD-ROM and install it.
   - Using the CLI, go to %system32%\inetsrv\adminsamples.
   - Run this:
           adsutil.vbs SET W3SVC/1/CreateCGIWithNewConsole 1
     (the number after "W3SVC/" may vary if you have multiple websites.
      If you have, repeat the procedure for all websites.)
     It'll say that CScript isn't set up to handle this. That's ok.
   - Click Ok.
   - Click yes, you want to register.
   - Run it again.
   - Using the ISM, restart all web sites.

cu,
  Martin
--
                        | Martin Vorlaender | VMS & WNT programmer
 VMS is today what      | work: mv@pdv-systeme.de
 Microsoft wants        |       http://www.pdv-systeme.de/users/martinv/
 Windows NT 8.0 to be!  | home: martin@radiogaga.harz.de


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

Date: Thu, 21 Jan 1999 17:46:27 -0500
From: "Brian Thompson" <hitbyabus@mindspring.com>
Subject: Reading a log file from an HTML Page
Message-Id: <788arj$blb$1@camel18.mindspring.com>

I am trying to give some employees access to a log file for security
monitoring........how do I access a log file? I try using the standard
technique:

#!/usr/local/bin/perl

open (LOG, "<../../logs/logfile.txt") || &ErrorMessage;
@logmessages = <LOG>;
close (LOG);

print "Content-type: text/html\n\n";
$n=1;
print "<UL><H2>Messages</H2></UL>";


#Here's where my problem is-----------------------------


foreach $message (@logmessages) {
 print "<LI>Message # $n was <I>$message</I>\n";
 $n++;
 }


sub ErrorMessage {
 print "Content-type: text/html\n\n";
 print "The server can't the file. It either doesn't exist or the
permissions are wrong. \n";
 exit;
}

That is an example I got from a book I'm reading.....my problem is, the
actual log file is about 16 lines long, How do I display all of these lines
instead of them running together in one straight line???

Thanks
Brian Thompson
www.createaweb.com




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

Date: Thu, 21 Jan 1999 21:58:18 GMT
From: scott.craig@moh.hnet.bc.ca
Subject: Re: Running a SQL query from a Perl CGI program
Message-Id: <7887tj$b3a$1@nnrp1.dejanews.com>

In article <36A73416.CCE54AE8@tek-tools.com>,
  Prabha Krishnan <prabha@tek-tools.com> wrote:

> I am a beginner to perl.
> I have a perl script that needs to run a query against an Oracle
> database. When i run this from the command line, it runs fine. But, when
>
> i call this script as a CGI from the browser, I donot get any results
> back. I am not sure what is happening. Attached is the perl script.
>

 This suggests to me that the ID that the browser is run under does not have
permission to run the sqlplus executable. It would probably be a good idea to
give it a special Oracle ID as well to limit the tables it can read.
 Incidentally, it would be easier to use Oraperl rather than go through the
shell.



-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Thu, 21 Jan 1999 22:17:05 GMT
From: dhosek@webley.com
Subject: Re: Running a SQL query from a Perl CGI program
Message-Id: <78890m$c54$1@nnrp1.dejanews.com>

In article <787qrk$nb$1@client2.news.psi.net>,
  abigail@fnx.com wrote:
> Prabha Krishnan (prabha@tek-tools.com) wrote on MCMLXIX September
> MCMXCIII in <URL:news:36A73416.CCE54AE8@tek-tools.com>:
> @@ System setup : Apache 1.2.5
> @@ Database : Oracle 8.0.5 on Red Hat Linux 5.1

> @@ I am a beginner to perl.
> @@ I have a perl script that needs to run a query against an Oracle
> @@ database. When i run this from the command line, it runs fine. But, when

> @@ i call this script as a CGI from the browser, I donot get any results
> @@ back. I am not sure what is happening. Attached is the perl script.

> So.... what error messages are you getting?
> Where's the -w?
> Where's the -T?
> Where's the 'use strict;'?
> What's the return value of open()?
> What's the result of the systems?
> What's wrong with unlink?

> If you do your utter best to have Perl not check any status codes, nor
> have it generate any error or warning messages, don't be surprised it
> silently fails!

While these are all good points, the primary reason why a CGI script will
work at the command prompt but fail as a CGI is a result of differing
environments between the command prompt run and the CGI run. Make sure that
@INC is the same in both circumstances and look at the database package
documentation to see if you need to set an environment variable or somesuch
either in a BEGIN block or in a wrapper script. Also, check to make sure that
paths are the same when you're running on the server as when you're running
from the command line. Grabbing errors on system commands will make all the
difference in the world in catching these.

Another debugging tip: Try to isolate the smallest possible bit of code that
will cause the failure. If you do that, 9 times out of 10, you'll be able to
spot the problem right away and the tenth time, it will be much easier to
find.

-dh


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Thu, 21 Jan 1999 15:53:36 -0600
From: "Matt Johnson" <cpuweb@cpuweb.com>
Subject: Trying to work with a text database
Message-Id: <7887om$41t$1@news.ipa.net>

I am TRYING to work with a text database but trying to sort it is becoming
difficult.
I have a double comma delimittered database EXAMPLE:

<FIELDS>,,Work Order Number,,First Name,,Last Name,,Order Date,,Due Date
11758,,Matt,,Johnson,,12-31-98,,01-05-99

I need to be able to seperate the fields such as "Work Order Number" and
sort all content by that field. Then be able to display all the fields after
its all sorted.

Anyone have any sugestions, please email cpuweb@cpuweb.com




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

Date: Thu, 21 Jan 1999 17:18:26 -0500
From: "Brian Thompson" <hitbyabus@mindspring.com>
Subject: Web Hosting Company Is Requestion Programmers
Message-Id: <788973$bv2$1@camel18.mindspring.com>

www.createaweb.com is now hiring Perl/mySQL Programmers, for more
information, email info@createaweb.com






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

Date: Thu, 21 Jan 1999 15:30:31 -0600
From: "Matt Johnson" <cpuweb@cpuweb.com>
Subject: Re: writing to files
Message-Id: <7886dd$35p$1@news.ipa.net>

If you take the file and put it into an array you can use the "unshift"
command to insert a line at the beginning of the array, and then write over
the file with the contents of the array.

open(file_db," filename.nope");
@newfile = <file_db>;
$newline="Whatever you want at the top of the file.";
unshift (@newfile, $newline)





J Holden wrote in message <7880mp$87d@news.voyager.net>...
>Is there any simple way to insert into the top of a file instead of
>jsut appending to the bottom?
>
>thnx
>
>




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

Date: Thu, 21 Jan 1999 22:46:16 GMT
From: jholden@voyager.net (J Holden)
Subject: Re: writing to files
Message-Id: <788ao2$m9j@news.voyager.net>

that worked great....
cept is should have been open (FILE, ">file.txt"); instead of jsut the
single ', but I am not nit picky

thanks again....


On Thu, 21 Jan 1999 20:25:23 -0000, "Mike Watkins"
<mwatkins@promotion4free.com> wrote:

>Hi there,
>
>Try this...
>
>open (FILE, 'file.txt');
>@File = <FILE>; close (FILE);
>chomp (@File);
>
>unshift (@File, $NEW_TOP_LINE);
>
>open (FILE, '>file.txt');
>foreach $Row (@File) {
>    print FILE "$Row\n"; }
>close (FILE);
>
>See ya,
>Mike
>
>J Holden wrote in message <7880mp$87d@news.voyager.net>...
>>Is there any simple way to insert into the top of a file instead of
>>jsut appending to the bottom?
>>
>>thnx
>>
>>
>
>



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

Date: 21 Jan 1999 20:43:15 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Y2K?
Message-Id: <7883h3$2dc$1@client2.news.psi.net>

Tuomas Angervuori (tumppi@icon.fi) wrote on MCMLXIX September MCMXCIII in
<URL:news:Un3NuHgI1diW-pn2-YtK140duKMbY@atte.dyn.icon.fi>:
|| I have a script which compares two dates.
|| -Clip-
||     ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = 
|| localtime(time);
|| #if current date is newer than the one mared in data files, update...
||         if (($year == $year_data) and ($mon >= $mon_data)) {
||             if ($mday > $mday_data) {
||                 &update;
||             }
||         }
||         if ($year > $year_data) {
||             &update;
||         }
|| -Clip-
|| 
|| $year_data, etc, are found from the data files.
|| 
|| As you might have noticed, this isn't year 2000 compatible.

And why isn't it year 2000 compatible?



Abigail
-- 
perl -e '$a = q 94a75737420616e6f74686572205065726c204861636b65720a9 and
         ${qq$\x5F$} = q 97265646f9 and s g..g;
         qq e\x63\x68\x72\x20\x30\x78$&eggee;
         {eval if $a =~ s e..eqq qprint chr 0x$& and \x71\x20\x71\x71qeexcess}'


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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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