[7708] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1334 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 17 21:17:36 1997

Date: Mon, 17 Nov 97 18:00:32 -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           Mon, 17 Nov 1997     Volume: 8 Number: 1334

Today's topics:
     Re: 500 Internal Server Error (Martien Verbruggen)
     Re: A wierd error: Premature end of script headers <jaydee@worsdall.demon.co.uk>
     Can't make DOS box under Win95 "see" .pl extensions... <emorr@fast.net>
     Re: Certificating users in a WWW page (Jeremy D. Zawodny)
     Design Suggestions Wanted for Link Index Script <philipm@nafohq.hp.com>
     Re: Design Suggestions Wanted for Link Index Script (Tad McClellan)
     Re: Error 500 on server??? (Martien Verbruggen)
     Re: eval and scoping problem <zenin@best.com>
     Re: exclusive file rights (Jeremy D. Zawodny)
     Re: exclusive file rights (Jeremy D. Zawodny)
     Re: Help: problem about sendmail <webmaster@fccj.cc.fl.us>
     Re: HELP: Problem about sendmail (Martien Verbruggen)
     Re: I am  having trouble reading in a variable from a f (Martien Verbruggen)
     Re: Newbie Q. How to flush print output mid-script? <webmaster@visionary-western.co.uk>
     Re: Newbie Q. How to flush print output mid-script? (brian d foy)
     Re: Newbie Q. How to flush print output mid-script? <philipm@nafohq.hp.com>
     Re: Newbie Q. How to flush print output mid-script? <philipm@nafohq.hp.com>
     Re: nt build of perl5.004_04 <tlockney@tivoli.nospam>
     Passing cgi variables HTML -> CGI -> 2nd HTML(SSL)... (John Black)
     Re: passing variables (Martien Verbruggen)
     Re: Perl + Lotus Notes (Jon Orwant)
     Perl and B+ tree implementation <malorenc@eden.rutgers.edu>
     Perl and INETD (Steve Johnson)
     Re: perl to browser ques (Jeremy D. Zawodny)
     Perl Tutotial <r64st@morgan.ucs.mun.ca>
     Re: Q: Precise Timestamps in Perl? (robert)
     question on DB_File module (and tie) (robert)
     Re: Removing text regex? (Tad McClellan)
     Re: split problems (Tad McClellan)
     Re: stripping Unix carraige returns (Jim Michael)
     Re: Upgrading from Active State to Current Build versio (Jeremy D. Zawodny)
     Re: Winnt and Unix Communication (Jeremy D. Zawodny)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 18 Nov 1997 01:09:47 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: 500 Internal Server Error
Message-Id: <64qpsr$bnb$1@comdyn.comdyn.com.au>

In article <comdog-ya02408000R1611971844090001@news.panix.com>,
	comdog@computerdog.com (brian d foy) writes:

(following up to this, because the article before this hasn't propagated 
to my server yet)

> In article <64if0e$i76@bgtnsc03.worldnet.att.net>, accu-scan@worldnet.att.net wrote:
> 
>>> perldoc perlfaq9
>>> 
>>> read the FAQ.
>>
>>I'm new, and getting this same error. You make reference to a FAQ to
>>read but you don't mention where it can be located. An oversight maybe?
>>I'd like to correct this problem if I can track down this FAQ.
> 
> www.perl.com has references to just about everything perl.

Apart from that, I did include where you could get the faq. Use the
perldoc command from your command line. It should have come with your
installation of perl, and so should the documentation.

perldoc perlfaq
perldoc perlfaq9

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | I took an IQ test and the results were
Commercial Dynamics Pty. Ltd.       | negative.
NSW, Australia                      | 


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

Date: Tue, 18 Nov 1997 00:44:41 +0000
From: Mark Worsdall <jaydee@worsdall.demon.co.uk>
Subject: Re: A wierd error: Premature end of script headers
Message-Id: <lIlkiJA5TOc0EwNn@worsdall.demon.co.uk>

In article <comdog-ya02408000R1611972320250001@news.panix.com>, brian d
foy <comdog@computerdog.com> writes
>In article <If3fHJAv+5b0Ewhy@worsdall.demon.co.uk>, Mark Worsdall 
><jaydee@worsdall.demon.co.uk> wrote:
>
>>In article <comdog-ya02408000R1611971900080001@news.panix.com>, brian d
>>foy <comdog@computerdog.com> writes
>>>In article <WbO5hbA1f2b0EwzD@worsdall.demon.co.uk>, Mark Worsdall 
>>><jaydee@worsdall.demon.co.uk> wrote:
>>>
>>>>What can cause this error? The script still seems to run, the error is
>>>>reported in the webservers error_log file.
>>>
>>>see the various FAQs referenced in the CGI Meta FAQ - especially the
>>>Perl section.
>>>
>>Already read it still no help:-) can you point me more closely to the
>>gaurded secret knowledge:-)
>
>the Idiot's Guide to Solving Perl CGI Problems should lead you to
>your error.  if not, it leads you through all the information that 
>you will need to provide to enable (empower?) someone to help you.
>
The program works fine does what it is suppose to do. My thoughts are as
suggested that somewhere the program is bumming out, but there it is
completeing all the time.

eeekkk!!
-- 
Mark Worsdall - Oh no, I've run out of underpants :(
Home:- jaydeeATworsdall.demon.co.uk  WEB site:- http://www.worsdall.demon.co.uk
Shadow:- webmasterATshadow.org.uk    WEB site:- http://www.shadow.org.uk


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

Date: 18 Nov 1997 01:38:03 GMT
From: "Edward W. Morris, Jr." <emorr@fast.net>
Subject: Can't make DOS box under Win95 "see" .pl extensions...
Message-Id: <01bcf3c2$8ffda120$0891f5ce@emorris>

Hey.  I've installed Perl build 5.003_07 for Win32 on my Win95 box.  I can
double click on a .pl script and it runs, but I can't run one from the Dos
box.  He says Unknown command, so I know he's not reading .pl extension
like he would .BAT or .EXE. What gives?  I know my registry is correct.  I
checked under Classes for .pl, which has Perl in it, and Perl has the
proper registry keys. they're the same as NT, which DOESN'T have this
problem. Thanks in advance!!!
--
email: emorr AT fast.net
web: http://www.users.fast.net/~emorr


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

Date: Tue, 18 Nov 1997 00:28:45 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: Certificating users in a WWW page
Message-Id: <3473e0f8.159855810@woody.wcnet.org>

[original author automagically cc'd via e-mail]

On Mon, 17 Nov 1997 19:20:11 GMT, rctlopes@uol.com.br (Roberto Lopes)
wrote:

>Please, anyone know how to access the .htaccess and .htpasswd via WWW?

You mean via Perl?

>It's without show the message box asking to the Username and Password.
>I have one directory for each user. I want to create a form with
>UserName and UserPassword and submit it to a perl cgi.

Oh... I get it. You're making a web client in Perl.

>The cgi will check the username and the password with the .htaccess
>and .htpasswd. If match, show the main page inside of the directory.

Or maybe not.

Why not let the web server do the work for you? That's what the
 .htaccess and .htpassword files are for, no?

Puzzled.

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: Mon, 17 Nov 1997 16:39:05 -0800
From: Philip Mikal <philipm@nafohq.hp.com>
Subject: Design Suggestions Wanted for Link Index Script
Message-Id: <3470E3A8.A75B50F4@nafohq.hp.com>

Hello comp.lang.perl.misc!

I am wishing to write a link index script similar in functionality to
Yahoo!

As a novice programmer, I am unsure of how to accomplish the task of
nested sub-directories (categories underneath the main listing -- e.g.,
Sports::Baseball, where Baseball is the sub-directory).

Any suggestions on how to accomplish this are greatly appreciated.

Thank you,

Philip M.



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

Date: Mon, 17 Nov 1997 19:16:11 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Design Suggestions Wanted for Link Index Script
Message-Id: <r8qq46.elb.ln@localhost>

Philip Mikal (philipm@nafohq.hp.com) wrote:

: I am wishing to write a link index script similar in functionality to
: Yahoo!

: As a novice programmer, I am unsure of how to accomplish the task of
: nested sub-directories (categories underneath the main listing -- e.g.,
: Sports::Baseball, where Baseball is the sub-directory).

: Any suggestions on how to accomplish this are greatly appreciated.


   File::Find


(that is a Perl module, the wheel you seek has already been invented)


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: 18 Nov 1997 01:37:10 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Error 500 on server???
Message-Id: <64qrg6$bnb$4@comdyn.comdyn.com.au>

In article <19971117093600.EAA06289@ladder02.news.aol.com>,
	hstudiosny@aol.com (HSTUDIOSNY) writes:
> 
> Any other suggestions on what is causing this error?

You might want to check the documentation that is written specifically
for this sort of question.

http://language.perl.com/faq/index.html

four links of your interest here:

FAQ (look at perlfaq9)
The (don't be offended by the name)Idiot's Guide to Solving Perl/CGI Problems
Perl CGI Programming FAQ
CGI Security FAQ

HTH
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: 18 Nov 1997 01:07:34 GMT
From: Zenin <zenin@best.com>
Subject: Re: eval and scoping problem
Message-Id: <879815411.372705@thrush.omix.com>

[ posted & mailed ]

Luc St-Louis <lucs@cam.org> wrote:
	>snip<
: 1. Why does Perl complain about B2, but not about A2?
: eval "\$pkg::A2 = 2";

	Your entire package gets eval()ed when you "use" it, including
	the inline 'eval "\$pkg::A2 = 2";' code, which in turn defines
	$pkg::A2 at compile time before the mention of it in your program
	code, thus it is "used more then once" and makes -w happy.

	Since the eval of $pkg::B2 doesn't happen until your run Foo, you're
	only "using it once" at compile time.

: 2. How can I use the 'eval' within sub Foo() without raising a complaint
: (while keeping 'use strict')?

	Use the vars pragma to declare package globals. -And on a similar note,
	stop using full package paths to point to variables in your current
	package, you're working too hard:

	package pkg;
	use strict;
	use vars qw($A1 $A2 $B1 $B2);
	$A2 = 2;

	#!/usr/local/bin/perl -w
	use strict;
	use pkg;
	print "$pkg::A2\n";

-- 
-Zenin
 zenin@best.com


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

Date: Tue, 18 Nov 1997 00:07:03 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: exclusive file rights
Message-Id: <3471dbd0.158535852@woody.wcnet.org>

[original author automagically cc'd via e-mail]

On Mon, 17 Nov 1997 20:53:23 -0800, someone@usenet.net wrote:

>Imagine two processes waiting for the lock.
>Process A finds out the file is free, but before it may lock it, 
>it gets suspended. Process B finds out the file is free, so it
>locks the file and continues, convicted he has locked the file.
>Now the process A wakes and relocks the file.
>
>And now both programs use the file at once, posibly subverting 
>the other's work.

Otherwise known as a "race condition".

>You need an atomic "create if nonexistent, fail otherwise".
>Do you have such?

One approach that I used a few years ago was to create links (using
link()) because it was an atomic [or so I believed] operation.

May work in the previous author's case.

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: Tue, 18 Nov 1997 00:04:46 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: exclusive file rights
Message-Id: <3470db41.158392296@woody.wcnet.org>

[original author automagically cc'd via e-mail]

On Mon, 17 Nov 1997 10:17:12 -0600, tadmc@flash.net (Tad McClellan)
wrote:

>This question has come up at least twice in the last month or so.
>
>Patching the docs would be a Good Idea.

I submitted the following patch this evening (my news reader seems to
want to wrap lines too much, you'll get the idea...):

--- perlfunc.pod        Tue Nov 18 07:44:12 1997
+++ perlfunc.pod.old    Tue Nov 18 07:40:39 1997
@@ -1132,10 +1132,6 @@
 is Perl's portable file locking interface, although it locks only
entire
 files, not records.

-Locks established by flock() are B<merely advisory>.  This means that
-files locked with flock() may be modified by programs which do not
-also use flock().  See your flock(2) manpage for details.
-
 OPERATION is one of LOCK_SH, LOCK_EX, or LOCK_UN, possibly combined
with
 LOCK_NB.  These constants are traditionally valued 1, 2, 8 and 4, but
 you can use the symbolic names if import them from the Fcntl module,


Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: Mon, 17 Nov 1997 20:00:19 -0500
From: "Bill Jones" <webmaster@fccj.cc.fl.us>
Subject: Re: Help: problem about sendmail
Message-Id: <3470e9a2.0@usenet.fccj.cc.fl.us>

Depending upon the version of Perl, I would say the the raw @ sign is the
cause; but you really should look in your $HTTP/Root/Logs/error.log and see
what Perl is complaining about...

Try enclosing all e-mail addresses in single quotes - IE. 'user@domain.net'

HTH,
Bill :-)

ChuoSenko wrote in message <64p6nt$r68$1@news.ksc.co.th>...
>I write perl the follow this
>#!/usr/local/perl
>open(SENDMAIL, "|/usr/lib/sendmail -t") ;
>print SENDMAIL <<EOF;
>From: user@domain1.com
>To: thada@chuosenko.th.com
>Subject: Daily status message
>Message
>EOF
>close(SENDMAIL)
>If i submit from html, the result has nothing.
>If i run on unix , i can get e-mail
>What is problem?
>
>Please send me e-mail, I will thank a lot.
>thada@chuosenko.th.com
>
>




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

Date: 18 Nov 1997 01:39:37 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: HELP: Problem about sendmail
Message-Id: <64qrkp$bnb$5@comdyn.comdyn.com.au>

(Why did you post this three times?)

In article <64p6hr$r63$1@news.ksc.co.th>,
	"ChuoSenko" <thada@chuosenko.th.com> writes:

> If i submit from html, the result has nothing.
> If i run on unix , i can get e-mail
> What is problem?

probably permission or path problems.

Check the FAQ's at http://language.perl.com/faq/index.html

(especially perlfaq9:My CGI script runs from the command line but not the
browser. Can you help me fix it?)

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | You can't have everything, where would
Commercial Dynamics Pty. Ltd.       | you put it?
NSW, Australia                      | 


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

Date: 18 Nov 1997 01:14:08 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: I am  having trouble reading in a variable from a file
Message-Id: <64qq50$bnb$2@comdyn.comdyn.com.au>

In article <346FBCD4.65A9@aol.com>,
	, snailgem@aol.com writes:
> What's the diff between the 2 ?
> 
>>  Besides, you should be using CGI.pm
>> nowadays, really.

cgi-lib.pl was written for perl4, and perl4 is dead. CGI.pm is for
perl5, has lots more features, is more stable, and can even be used
the same way as cgi-lib.pl. Not many arguments to not use it :)

Martien

-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | If at first you don't succeed, try
Commercial Dynamics Pty. Ltd.       | again. Then quit; there's no use being
NSW, Australia                      | a damn fool about it.


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

Date: Sun, 16 Nov 1997 15:15:01 +0000
From: John <webmaster@visionary-western.co.uk>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Newbie Q. How to flush print output mid-script?
Message-Id: <346F0DF5.1511@visionary-western.co.uk>

Tom Phoenix wrote:

> Bigger question: Does your sysadmin like the idea of your script hanging
> around uselessly hogging system resources for five minutes? A CGI script
> should be made to get the job done and clear out quickly, since it may be
> called again several times per _second_ on a busy server, or when your URL
> just appeared on the Today show. :-)
> 
> If I were your sysadmin, I'd disable that script on sight. Even if it did
> return the html to the browser at once. :-)
> 
> What are you trying to accomplish by a five-minute sleep? If you're hoping
> that this will prevent someone from repeatedly triggering your script,
> you're going down the wrong road.


Hi Tom!

Good reply.

The guy I'm writing the script for is not a programmer, but has very
definite opinions about what he thinks a good script ought to do. Thats
the worst kind of brief anyone can have! Personally I can't see why the
damn file can't sit there until it's overwritten, (ref: my other post
for more details on the system) rather than deleting after five minutes.

However, I can't think of any other way right now to kill a file from
perl five minutes after a script has run, probably because Perl/CGI
isn't my native tongue. The client only has a normal web space account
with CGI, on a server 300 miles away. Fortunately it's not in my name!

John L


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

Date: Mon, 17 Nov 1997 19:36:31 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Newbie Q. How to flush print output mid-script?
Message-Id: <comdog-ya02408000R1711971936310001@news.panix.com>

In article <346F0DF5.1511@visionary-western.co.uk>, John <webmaster@visionary-western.co.uk> wrote:

>However, I can't think of any other way right now to kill a file from
>perl five minutes after a script has run, probably because Perl/CGI
>isn't my native tongue. The client only has a normal web space account
>with CGI, on a server 300 miles away. Fortunately it's not in my name!

not not just have a cron job run periodically than deletes files older
than 5 minutes?  a lot better than having a bunch of CGI programs sucking
memory. :)

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Mon, 17 Nov 1997 17:21:10 -0800
From: Philip Mikal <philipm@nafohq.hp.com>
To: John <webmaster@visionary-western.co.uk>
Subject: Re: Newbie Q. How to flush print output mid-script?
Message-Id: <3470ED85.72FB0D40@nafohq.hp.com>

Hello:

How about have your script start a cron job so your system will do it later...
even though I don't know why you'd want to do such a thing.

Regards.

Philip M.

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

John wrote:

> > > Question. Why does the script not return its html output to the browser
> > > until 300 seconds are up? Presumably there's a command which could flush
> > > the output before it starts to sleep? I've drawn a blank with the
> > > manual, any help would be appreciated (grin).
> > > John L
> >
> > Hi John!
> >
> > Server executes script and waits for script to finish
> > before sending output to your browser..
> > This script will not finish until after 300 sec. Right?!
> >
> > welcome:)
>
> Hi Eugene!
>
> Thanks for the reply!
>
> That's right. The script is part of a newsboard/chat system. Most of the
> system is written in javascript (which I'm much more familar with) and
> I'm just using perl for basic file i/o.
>
> At the beginning of the perl script the message is written to an html
> file so the rest of the world can see it, next a copy of the message is
> sent to the poster's browser so he or she can see it too, five minutes
> later the hard copy html file is wiped. (Yea, I know it's a strange way
> to write a chat system but it's what the client wanted...). The script
> is working perfectly but buffering up all its output until the end,
> which makes for very brief conversations. The script is a little long to
> paste in its entirety but, word for word, the last part is:
>
>         print "<\/pre><br><hr><\/body><\/html>\n";
>         }
>
>         sleep (300);
>
>         $quit = 'file deleted';
>         open (FH, ">$filepath$filenew");
>                 print FH $quit;
>         close (FH);
>         exit ;
>
> This help is greatly appreciated, thanks again!
>
> John L.





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

Date: Mon, 17 Nov 1997 17:21:18 -0800
From: Philip Mikal <philipm@nafohq.hp.com>
Subject: Re: Newbie Q. How to flush print output mid-script?
Message-Id: <3470ED8D.7757752D@nafohq.hp.com>

Hello:

How about have your script start a cron job so your system will do it later...
even though I don't know why you'd want to do such a thing.

Regards.

Philip M.

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

John wrote:

> > > Question. Why does the script not return its html output to the browser
> > > until 300 seconds are up? Presumably there's a command which could flush
> > > the output before it starts to sleep? I've drawn a blank with the
> > > manual, any help would be appreciated (grin).
> > > John L
> >
> > Hi John!
> >
> > Server executes script and waits for script to finish
> > before sending output to your browser..
> > This script will not finish until after 300 sec. Right?!
> >
> > welcome:)
>
> Hi Eugene!
>
> Thanks for the reply!
>
> That's right. The script is part of a newsboard/chat system. Most of the
> system is written in javascript (which I'm much more familar with) and
> I'm just using perl for basic file i/o.
>
> At the beginning of the perl script the message is written to an html
> file so the rest of the world can see it, next a copy of the message is
> sent to the poster's browser so he or she can see it too, five minutes
> later the hard copy html file is wiped. (Yea, I know it's a strange way
> to write a chat system but it's what the client wanted...). The script
> is working perfectly but buffering up all its output until the end,
> which makes for very brief conversations. The script is a little long to
> paste in its entirety but, word for word, the last part is:
>
>         print "<\/pre><br><hr><\/body><\/html>\n";
>         }
>
>         sleep (300);
>
>         $quit = 'file deleted';
>         open (FH, ">$filepath$filenew");
>                 print FH $quit;
>         close (FH);
>         exit ;
>
> This help is greatly appreciated, thanks again!
>
> John L.





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

Date: Mon, 17 Nov 1997 17:00:41 -0600
From: Thomas Lockney <tlockney@tivoli.nospam>
Subject: Re: nt build of perl5.004_04
Message-Id: <3470CC98.147083DF@tivoli.nospam>

Well, no body seems to be jumping on this one, so maybe y'all can help me
with this.

I'm needing to set up a basic client server system on a number of
different boxes (mixed unix/NT). All of the client server examples I've
seen have relied upon fork to work. This won't be possible with any build
of NT perl that I've yet seen. Any clues.

If anyone knows where a binary of the standare distribution is available
for NT (with modules available also), please reply.

Thanks,
Thomas

Thomas Lockney wrote:

> Ok, supposedly perl5.004_04 should build on an nt box with cygnus' gnu
> utilities, right?
>
> Well, everytime I try to build it, the configure script fails out when
> it tries to test gcc. I copied the wrappers that are in the cygwin32
> directory to my bin directory, but still no luck.
>
> Anybody else have any success with this?
>
> Thanks in advance,
> Thomas Lockney
> Tivoli Systems
> tlockney@tivoli.com





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

Date: Tue, 18 Nov 1997 00:57:08 GMT
From: john1@runningman.com (John Black)
Subject: Passing cgi variables HTML -> CGI -> 2nd HTML(SSL)...
Message-Id: <64qou3$jgu@bgtnsc03.worldnet.att.net>


I need to have an HTML form on an unsecure server collect data, and
then have the cgi script (Perl 5) pass the data via a hidden field to
an HTML page on a secure server. At that point a user could enter the
payment information, and have a generic PGP Formmail script send the
payment data along with the hidden field data via e-mail.

I've got everything in place except... I can't figure out how to write
the data $FORM{'variable'} into the second HTML page.

The whole problem stems from the fact that all I can run on the SSL
server is the PGP Formmail (no other cgi). Thus I collect all of the
data and offer the choice to call in the payment information, or
proceed to a SSL page and enter the data.

Has anyone else done this? Any work arounds?

Thanks,

John


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

Date: 18 Nov 1997 01:23:08 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: passing variables
Message-Id: <64qqls$bnb$3@comdyn.comdyn.com.au>

In article <64nuom$2tv@bgtnsc02.worldnet.att.net>,
	jsaya@iname.com (John Saya) writes:
> Can someone please email me on how you would pass a variable in this
> program, using the sub url_get.pl to a subroutine.  It seems it's
> passing the word $host rather than what $host is equal to.

how did you test that?

It passes what $host contains. $host simply doesn't contain what you
think it does.

> #!/usr/local/bin/perl
> 
> require 'url_get.pl';
> 
> print "Host: ";
> $line = <STDIN>;
> $host = chop ($line);

print "Host is now: $host\n";

> 
> &url_get($host);
> 
> exit;


That would have told you that $host is empty. 

perldoc -f chop

(last few lines)
Note that chop returns the last character.  To return all but the last
character, use C<substr($string, 0, -1)>.


The text above that would have told you to use something like:

chop ($host = $line);

More advice:
	use chomp instead of chop
	always run perl with the -w flag
	use strict

HTH
Martien

-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | If at first you don't succeed, try
Commercial Dynamics Pty. Ltd.       | again. Then quit; there's no use being
NSW, Australia                      | a damn fool about it.


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

Date: 17 Nov 1997 21:40:53 GMT
From: orwant@fahrenheit-451.media.mit.edu (Jon Orwant)
To: Jan Krynicky <Jan@chipnet.cz>
Subject: Re: Perl + Lotus Notes
Message-Id: <ORWANT.97Nov17164053@fahrenheit-451.media.mit.edu>


In article <346409CE.139B@chipnet.cz> Jan Krynicky <Jan@chipnet.cz> writes:

   From: Jan Krynicky <Jan@chipnet.cz>

   I need to export some data from the address book of our notes server,
   is there any way to do it by a perl script so that I could
   export it regularly and compare the data with the WinNT user list 
   and the list of emplayee changes I get from our admin department.

   I'd like some (semi)automatic way to delete vanished users
   and add new ones etc.

   Is there a module for perl-to-notes comunication?
   Could I use OLE to control notes?

   The server runs on WinNT4.0, I use Activeware Perl 5.003 build 310.

I'm writing a Perl Lotus Notes API, very slowly, with lots of help
from IBM.  It'll be ready sometime in Q1 or Q2 of 1998.

It's pure XS and will let you read and write Notes databases from Perl.  
It won't have anything OLE-specific.

-Jon

------------------------------------
Jon Orwant            http://tpj.com
Editor & Publisher, The Perl Journal


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

Date: Mon, 17 Nov 1997 20:34:02 -0500
From: Mark Lorenc <malorenc@eden.rutgers.edu>
Subject: Perl and B+ tree implementation
Message-Id: <3470F08A.89532766@eden.rutgers.edu>

Howdy:

I'm currently taking a class on databases at my university. In this
class, it is required that I write an implementaion of a b+ tree in
whatever language I choose. Obviously - I'd really like to write it in
perl. I've used perl  for sys admin cases, various scripts, and cgi
stuff, however this is new and seems to have me stumped. What would be
the best way to implement a tree node (manually) in perl? It would have
to contain a few data fields, and an equal number of "pointers" that
refer to other nodes. This would normally implemented with a structure
in C, or a big hoochin list in lisp, etc, .... but ....
                                    .... how in perl?


Thanks,
-mark



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

Date: 18 Nov 1997 01:10:39 GMT
From: sjohnson@twisted.napanet.net (Steve Johnson)
Subject: Perl and INETD
Message-Id: <64qpuf$kap$1@wiley.napanet.net>


I want a perl script to execute from inetd, Is this possible?   It's a
simple script that outputs text and gets input and then ends.  When ever
inetd calls it up it just hangs there, no i/o at all.  I have it set up to
work on the telnet port.  Here is my inetd entry

telnet  stream  tcp     nowait  root    /bin/greeting.pl


and here is greeting.pl

#!/usr/bin/perl
print "Hello, and welcome online, thank your for visiting us.\n";
print "Please leave us your e-mail address so we can contact your.\n";
print "Your Address is ->";
chop($email = <STDIN>);
print "Thank you.. \n";



Thats the basic idea of what I have, But like I said, when I telnet to the
machine it just hangs there, Can someone help me out?  Thanks


-Steve




--
--
Steve Johnson               NapaNet                        Network  Admin.
sjohnson@napanet.net         Napa,  CA              http://www.napanet.net


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

Date: Tue, 18 Nov 1997 00:31:08 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: perl to browser ques
Message-Id: <3474e157.159950606@woody.wcnet.org>

[original author automagically cc'd via e-mail]

On Mon, 17 Nov 1997 14:33:07 -0600, "Brian Wrenn (1740 co-op)"
<1740.co-op.0517515@nt.com> wrote:

>I'm fairly new at perl, so this may seem very entry level to most, but I
>have a perl (Perl for Win 32) script that does exactly as it should
>(calls a java program in the same directory)

Have you verified the Current Working Directory (CWD) of the spawned
process?

>when I run it on the DOS
>window command line, but when I run it through CGI with Netscape 4.0,
>none of the java program's standard output displays in the browser.  I
>only get the printed regular html text.  I'm calling the java program
>like this:
>
>print "Content-type: html/text\n\n";
>print "<html><head><title>My Script</title></head>";
>print "<body>";
>print "<h1>My Script</h1>\n";
>$buffer = `java myprog arg1 arg2 arg3`;  # <- this is what doesn't

Is the path set correctly? Are permission setup appropriately?

>$exit_code = $?>>8;                      #    output through Netscape
>print $buffer;
>print "</boyd></html>";

You mean </body>, right?

>If there is a better way to do the same thing, please tell me.

Well, you could always make the Java program CGI-aware. I'm led to
believe that this isn't hard in Java. But this *is* a Perl
newsgroup... :-)

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: Mon, 17 Nov 1997 18:44:41 -0330
From: Simon Thangasamy <r64st@morgan.ucs.mun.ca>
Subject: Perl Tutotial
Message-Id: <Pine.OSF.3.95.971117184338.8173A-100000@plato.ucs.mun.ca>


Hi,

Can anyone please tell me where I can find a Perl tutorial on the web.

Thanks.



		     



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

Date: 14 Nov 1997 11:31:32 +0100
From: robert@il.fontys.nl (robert)
Subject: Re: Q: Precise Timestamps in Perl?
Message-Id: <64h9a4$s7n@bsd1.hqehv-internal.ilse.net>

Gary Howland <ghowland@hotlava.com>:
 >On Solaris you can do something like this to get better accuracy:
 >sub hires_time {
 >        my $x = "\0" x 8;
 >        syscall(191, 0, $x) && croak "clock_gettime() system call failed
 >($!)";
 >        unpack("L L", $x);
 >}

How about this (for free! ;):
-
require 'syscall.ph';	# run h2ph on /usr/include/sys/syscall.h first!

sub	hires_time
{
	my $x = "\0" x 8;
	syscall(&SYS_gettimeofday, $x, 0) && return undef;
	unpack("L L", $x);
}
-

                                                                 robert


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

Date: 14 Nov 1997 11:41:04 +0100
From: robert@il.fontys.nl (robert)
Subject: question on DB_File module (and tie)
Message-Id: <64h9s0$sad@bsd1.hqehv-internal.ilse.net>

Hey all,

I'm using something similar to the following in one of my programs:
$db = tie %hash, DB_File, "test", O_CREAT|O_TRUNC|O_RDWR, 0644;

Now, I don't really need that $db for very long, just long enough to get
the filedescriptor ($db->fd) so I can lock the database-file.

Is it save for me to undef $db right after I fetched the filedescriptor,
but continue to work with %hash?

In code, something like this:
-
$db = tie %hash, DB_File, "test", O_CREAT|O_TRUNC|O_RDWR, 0644;
$fd = $db->fd;
undef $db;
 ...		# lock or something
$hash{'test'} = "this is a test";
untie %hash;
-

I know I can just wait with undef'ing $db 'till right before the untie,
but I would rather not.

                                                                 robert


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

Date: Mon, 17 Nov 1997 19:02:22 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Removing text regex?
Message-Id: <uepq46.rhb.ln@localhost>


William L. Gorder (no@spam.please) wrote:
: I am a newbie at regular expressions (and a total Perl neophite) and I have
                   ^^^^^^^^^^^^^^^^^^^

If I understand correctly what you want to do, then you don't need regexs...


: been trying to come up with an understanding of how I would accomplish the
: following: I need to remove a section or sections of text from a file (well,
: OK, 2000+ files).  The text in question looks something like this:

:               LD               ID                =  "L501"
:                                EB                =  "SS"
:                                LG                =  "STATEEST"
:                                WEXIST            =   0.0
:                                VEXIST            =   0.0

:               LDXM             MW                =  "N"
:                                MVAR              =  "N"

:               VL               ID                =  "EQX"

: That is, an identifier (in this case "LD" or "LDXM") followed by any number
: of attributes (the lines with "=")followed by another identifier.  I do not
: want to delete the line with the following identifier, in this case, the
: deletion should end at the end of the line *before* the "VL" identifier.


So, I guess you want to delete 'records' that start with LD or LDXM,
with each record being separated by a blank line?


I'd use 'paragraph mode' to get a 'record' at a time:

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

$/ = "";  # enable 'paragraph mode'

while (<DATA>) {
   print unless /^\s*(?:LDXM|LD)\s/;
}



__DATA__
              LD               ID                =  "L501"
                               EB                =  "SS"
                               LG                =  "STATEEST"
                               WEXIST            =   0.0
                               VEXIST            =   0.0

              LDXM             MW                =  "N"
                               MVAR              =  "N"

              VL               ID                =  "EQX"
-----------------


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: Mon, 17 Nov 1997 19:00:11 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: split problems
Message-Id: <rapq46.rhb.ln@localhost>


Wim Verhaegen (verhaege@esat.kuleuven.ac.be) wrote:

: I am facing the following problem: I need to parse a file containing
: lines like

: mxxx a b c d e  par1=val1  par2=val2  attr3  par4 = val4 attr5


[snip]

: This brings me to my second question. It would be a lot easier if
: I could
: split off a part of a string, and get the remainder of the string which
: split has not looked at (or at least the starting position of the
: remainder).

: Any idea how this can be accomplished?


I think the three argument version of split() can help you here.


You mean something like this?

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

$_ = 'm1 a b c d e foo=5 bar=6 foobar pi=3.1415';

($name, $a, $b, $c, $d, $e, $rest) =  split /\s+/, $_, 7;

@pars = split /\s+/, $rest;

foreach (@pars) {
   print "'$_'\n";
}
--------------------------


If that does what you want, then you can get the whole thing at once:

   ($name, $a, $b, $c, $d, $e, @pars) =  split /\s+/;


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: Mon, 17 Nov 1997 22:25:30 GMT
From: genepool@netcom.com (Jim Michael)
Subject: Re: stripping Unix carraige returns
Message-Id: <genepoolEJtAAI.LrE@netcom.com>

On your NT box rename one of the files in 8.3 format and use debug to view
the file in hex. In the DOS filesystem a "carriage return" (=newline) is
really CR+LF or in hex 0D0A. I don't know how your Unix files are getting
to the dark side but if you ftp them in ascii mode the newlines are
translated for you, so you can use a regex like

$myTextAreaContents=~s/\n/ /g;

to get rid of the newlines in that variable. If you wind up with 
something odd like I ran into recently where MS Internet Assistant was 
writing 0D instead of 0D0A, you may find that your script will not 
find 0D in a regex unless you read the file in binary mode (just use 
binmode FILEHANDLE after opening the file). Hope this helps.

Cheers,

Jim


Mark Aurit (mark_aurit@mail.northgrum.com) wrote:
: I have a web page that uses Perl to write the output of a form to a
: comma-seperated file, which I download into Excel 
: (the file is created on a SGI Box running IRIX (Unix)).
: The problem is when people use carriage returns in
: Textarea boxes; Excel doesnt like them!
: So obviously, I need to do a simple pattern match and
: replace; just convert any carraige returns to spaces.
: The manual I have isnt clear on what character represents
: a carriage return (again, this is on Unix). Can someone help
: me with this?

: Thanks, Mark
: auritma@NOSPAM.mail.northgrum.com


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

Date: Tue, 18 Nov 1997 00:50:26 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: Upgrading from Active State to Current Build versions
Message-Id: <3475e613.161162088@woody.wcnet.org>

[original author automagically cc'd via e-mail]

On Mon, 17 Nov 1997 21:19:09 GMT, rbj@NOSPAMix.netcom.com (Doran)
wrote:

>I'm currently using Active State's build 3.13 on my NT and Win95
>machines, but would just as soon use one of the current builds of
>Perl. What is the best way to uninstall the old one and install the
>new? Should I just blow everything away and start from scratch or can
>I install the new one over the old. Active State's version seems to be
>a little (lot?) different from the "real" version, that's why I ask.

I'd blow away what you've got, assuming that you have not
custom-developed modules in your lib directory that you need to save,
and go from there.

I've actually had the two co-exisiting on my system, but I find myself
only ever using 5.004 anyway.

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: Tue, 18 Nov 1997 00:26:44 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: Winnt and Unix Communication
Message-Id: <3472e06a.159713185@woody.wcnet.org>

[original author automagically cc'd via e-mail]

On 17 Nov 1997 15:45:49 GMT, "Keith Chern" <ljchern@singnet.com.sg>
wrote:

>Anybody know how perl in an Unix system could trigger an NT/Win95 on the
>same network of IP protocol to run an executable or WinPerl on the NT/Win95
>to run a script? Is it by using socket communication? 

Sure. You could write perl daemon that runs on the NT box which waits
for whatever signal and does its job.

>Unix and Unix communication can easily automate the trigger by automate a
>telnet login and execute on the telnet services right? Whereas Unix and
>WinNT/Win95 is another story.

True. But if you think about it in a more general sense, you're just
communication with one of the many TCP/IP enabled daemons on the Unix
box. The same can happen on NT/95.

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

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

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