[8887] in Perl-Users-Digest
Perl-Users Digest, Issue: 2505 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 5 14:20:18 1998
Date: Tue, 5 May 98 11:01:50 -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 Tue, 5 May 1998 Volume: 8 Number: 2505
Today's topics:
How to make a "Please wait" page during script processi <jlippiner@iname.com>
Re: Input to programs (RonaldWS)
Re: is it possible to parameterize a class name? (Ed.Q.Bridges)
Re: is it possible to parameterize a class name? (Ed.Q.Bridges)
Re: Is this a safe lock? <jamesr@aethos.co.uk.nospam>
Re: passing .htaccess login info (brian d foy)
Re: passing .htaccess login info (brian d foy)
Re: PERL AND MS ACCESS <perlguy@inlink.com>
Rounding a number <michael@datahost.com>
Re: Rounding a number (brian d foy)
Re: Running script as background program. <jamesr@aethos.co.uk.nospam>
Re: Sending perl HTML output to diffrent frames <grinch@whoville.com>
SF.pm perl user's group! <lanier@shell6.ba.best.com>
splitting the screen <aqumsieh@matrox.com>
Re: splitting the screen <Tony.Curtis+usenet@vcpc.univie.ac.at>
Torvalds.com (Ed Jamison)
Re: What it perl? <perlguy@inlink.com>
Re: writing to a file (Chris Hamilton)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 5 May 1998 13:38:43 -0400
From: "Joshua Lippiner" <jlippiner@iname.com>
Subject: How to make a "Please wait" page during script processing?
Message-Id: <6inj1f$t8a$1@winter.news.erols.com>
Hello:
I just wrote some perl scripts which take a bit of time to process after
they read in form data. I would like my URL to either change to say "Please
wait, Processing..." and then bring up the finished URL after processing or
have some kind of JavaScript window pop up that says the same, maybe with
some moving dots. What is the best way to do this? Thanks.
Josh Lippiner
------------------------------
Date: 5 May 1998 17:58:18 GMT
From: ronaldws@aol.com (RonaldWS)
Subject: Re: Input to programs
Message-Id: <1998050517581801.NAA24679@ladder01.news.aol.com>
In article <6ik0ce$6ic$1@nnrp1.dejanews.com>, poster@prm.se writes:
>Subject: Input to programs
>From: poster@prm.se
>Date: Mon, 04 May 1998 04:05:18 -0600
>
>Hello
>
>I have a problem that I can't seem to find the answer to anywhere.
>
>What I'm trying to do:
>I have to unzip crypted zip-files in Unix.
>From the command-line, after I started unzip, it stops and waits for the
>password. There are no command-line arguments for passwords. I want the
>perl-script to insert the password at the appropriate time.
>
>The order of work is something like this:
>1. Take all the crypted files into an array.
>2. Make an unzip on all the files in the array. All files are encrypted with
>the same password.
>
>What I'd like to know:
>How to give the password (string) to the (any) program when its waiting for
>input.
>
>This will normally give security problems but everything will run in a very
>secure environment.
>
>I hope I managed to explain myself :-)
>
>Thanks in advance
>
>
If the program gets the password from standard input and is the only thing
being read from stdin you could try
open(FH, "| unzip $myfile");
print FH "password";
If the program needs multiple inputs and you need to do some parsing to detect
exactly when the password is need you may want to try IPC::Open2 and something
like.
use IPC::Open2;
use Symbol;
my ($rdr, $wtr) = (gensym(), gensym());
$pid = open2($rdr, $wtr, "unzip $myfile");
while (<$rdr>) {
if (/give me a password/) {
print $wtr "password";
}
etc.
}
Ronald Schmidt
The Software Path
Software Engineering
------------------------------
Date: Tue, 05 May 1998 16:56:04 GMT
From: edb@interport.net (Ed.Q.Bridges)
Subject: Re: is it possible to parameterize a class name?
Message-Id: <354f4226.98140498@news.spry.com>
>This has been asked a bunch of times recently. Maybe it ought to be
>added to the FAQ list... Search DejaNews for the subject line
>"*Really* dynamic function loaing?" There's a thorough answer in that
>thread. You should also
a search on dejanews using this subject line (both with and without
typo) returned no results. do you remember any of the author's names?
>
> C:\> perldoc -f use
>
>which will explain to you that use Foo; is a synonym for
>
> BEGIN { require Foo; import Foo }
>
thanks, i knew that (and tried it) already. the problem is that
a BEGIN forces the require at compile time, not run time.
i'm trying to insert a value to be required at runtime.
when i code this:
my($foo) = shift;
BEGIN { require $foo; import $foo; }
i get this:
Null filename used at ./main.pl line 9.
BEGIN failed--compilation aborted at ./main.pl line 9.
>
>You'd make that a lot easier if you wouldn't put that silly fake
>address in your headers.
>
my apologies. it's been changed.
TIA
--e--
------------------------------
Date: Tue, 05 May 1998 16:57:47 GMT
From: edb@interport.net (Ed.Q.Bridges)
Subject: Re: is it possible to parameterize a class name?
Message-Id: <354f44fc.98866041@news.spry.com>
>This has been asked a bunch of times recently. Maybe it ought to be
>added to the FAQ list... Search DejaNews for the subject line
>"*Really* dynamic function loaing?" There's a thorough answer in that
>thread. You should also
a search on dejanews using this subject line (both with and without
typo) returned no results. do you remember any of the author's names?
>
> C:\> perldoc -f use
>
>which will explain to you that use Foo; is a synonym for
>
> BEGIN { require Foo; import Foo }
>
thanks, i knew that (and tried it) already. the problem is that
a BEGIN forces the require at compile time, not run time.
i'm trying to insert a value to be required at runtime.
when i code this:
my($foo) = shift;
BEGIN { require $foo; import $foo; }
i get this:
Null filename used at ./main.pl line 9.
BEGIN failed--compilation aborted at ./main.pl line 9.
>
>You'd make that a lot easier if you wouldn't put that silly fake
>address in your headers.
>
my apologies. it's been changed.
TIA
--e--
------------------------------
Date: 5 May 98 14:15:37 GMT
From: "James Richardson" <jamesr@aethos.co.uk.nospam>
Subject: Re: Is this a safe lock?
Message-Id: <01bd7831$c141fda0$26c0a4c1@kitkat.aethos.co.uk>
Peter A Fein <p-fein@uchicago.edu> wrote in article <87u375m864.fsf@bj2-64.rh.uchicago.edu>...
> Specifically, because the entire operation (through the end of the
> acquire part) needs to be atomic, which it's not. Right?
It's this old indivisible read-modify-write, can't be done in user mode stuff....
Tom...I seem to remember having a conversation about this with you & a few others
(flock / lockf /touch (erk) etc) a couple of years ago on the (now defunct, but used to be highly informative) perl cgi mailing
list...
I also seem to recall that it became defunct because there were many people re-asking the same old questions day in & day out....
Cheers!
James Richardson
------------------------------
Date: Tue, 05 May 1998 13:31:29 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: passing .htaccess login info
Message-Id: <comdog-ya02408000R0505981331290001@news.panix.com>
Keywords: from just another new york perl hacker
In article <354EFAFE.3B41AE92@bwsd.com>, bwsd@bwsd.com posted:
>I need to get a script to pass the .htaccess login info to the script so
>that if the username and password match in an .htaccess protected
>directory, the script then performs other functions.
>
>The user logs on with username and password...according to .htaccess
>file. However, the password is encrypted in the .passwd file specified,
>and also, I don't know how to trap the input variables from the pop up
>login box that pops up when an .htaccess protected directory is accessed
>on the web.
sounds like you need mod_perl which will let you interact with the
server at various stages of the process. otherwise, you won't get
the info that you need.
see the CGI Meta FAQ for references.
good luck :)
--
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 <URL:http://www.pm.org>
------------------------------
Date: Tue, 05 May 1998 13:32:44 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: passing .htaccess login info
Message-Id: <comdog-ya02408000R0505981332440001@news.panix.com>
Keywords: from just another new york perl hacker
In article <6inchd$elr$1@duke.squonk.net>, chrish@squonk.net (Chris Hamilton) posted:
>Beck Web Servers & Design (bwsd@bwsd.com) wrote:
>: The user logs on with username and password...according to .htaccess
>: file. However, the password is encrypted in the .passwd file specified,
>: and also, I don't know how to trap the input variables from the pop up
>: login box that pops up when an .htaccess protected directory is accessed
>: on the web.
>As far as the password goes, there isn't a way to pass or retreive the
>value unless you design your own method of authenticaion (or possibly hack
>the webserver source code).
use mod_perl with the Apache::* family of modules...
--
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 <URL:http://www.pm.org>
------------------------------
Date: Tue, 5 May 1998 15:35:27 GMT
From: Brent Michalski <perlguy@inlink.com>
To: ananta@w-o-i.com
Subject: Re: PERL AND MS ACCESS
Message-Id: <354F31BF.952C87B1@inlink.com>
You need to get the ODBC module from www.roth.net. I think I got all of
this code from there as a matter of fact. Or, at least a good starting
point. Print out the manual, it is a lifesaver.
And then do:
sub Create_DB_Connection{
$DSN="your_database";
use Win32::ODBC;
if (!($db = new Win32::ODBC($DSN))) {
print "Error connecting to $DSN\n";
print "Error: " . Win32::ODBC::Error() . "\n";
exit;
}
return;
} # End of subroutine.
HTH,
BRent
------------------------------
Date: Tue, 05 May 1998 09:33:35 -0500
From: Michael Stearns <michael@datahost.com>
Subject: Rounding a number
Message-Id: <354F232A.63AE@datahost.com>
I looked in the perlfunc man page and did not see a function for
rounding a number. Is there such a beast or could someone tell me a good
way to round a number with Perl?
Thanks,
Michael Stearns
------------------------------
Date: Tue, 05 May 1998 13:39:58 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Rounding a number
Message-Id: <comdog-ya02408000R0505981339580001@news.panix.com>
Keywords: from just another new york perl hacker
In article <354F232A.63AE@datahost.com>, michael@datahost.com posted:
>I looked in the perlfunc man page and did not see a function for
>rounding a number. Is there such a beast or could someone tell me a good
>way to round a number with Perl?
sprintf() or printf()? see Tom Phoenix's article in the Winter 1997
issue of the Perl Journal [1] for lots of information about rounding in
Perl.
good luck :)
[1] The Perl Journal <URL:http://www.tpj.com>
--
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 <URL:http://www.pm.org>
------------------------------
Date: 5 May 98 14:21:20 GMT
From: "James Richardson" <jamesr@aethos.co.uk.nospam>
Subject: Re: Running script as background program.
Message-Id: <01bd7832$8e218020$26c0a4c1@kitkat.aethos.co.uk>
Derek Blandford <blan0416@uidaho.edu> wrote in article <354EB68E.53B39C11@uidaho.edu>...
> I've created a chat written in Perl that uses sockets. The main program
> needs to run continously, meaning I need to be able to shut down telnet
> without it closing the program. I'm not sure if this is a Perl question
> or a Unix question, so it's posted in both. Please reply at least via
> email....thanks a million.
You mean you want to set up a chat server? A chat daemon?
Try fork()... (perldoc -f fork)
Or, there are many chat servers on the internet already that have distributable source, many written in perl...(yahoo!)
Socket programming (doing it well) is not for the unix beginner though, (IMHO) , so good luck!
James
------------------------------
Date: Tue, 5 May 1998 12:40:41 -0400
From: "Grinch" <grinch@whoville.com>
Subject: Re: Sending perl HTML output to diffrent frames
Message-Id: <6inefk$rcc@fridge.shore.net>
Adam Carden wrote in message
<894359785.10329.0.nnrp-04.c2de97e4@news.demon.co.uk>...
>I do apologise if this is the wrong group as I am not sure where to post
>it(perl, html or cgi?)
HTML. You want to use the "target" attribute.
HTH!
-grinch
--
-----
"It's not real coffee unless the sugar cubes float." - me
Sherm Pendley
grinch@whoville.com
http://www.whoville.com
------------------------------
Date: Tue, 5 May 1998 09:52:43 -0700
From: "matthew d. p. k. lanier" <lanier@shell6.ba.best.com>
Subject: SF.pm perl user's group!
Message-Id: <Pine.BSF.3.96.980505094530.15661A-100000@shell6.ba.best.com>
hello all-
yesterday, the san francisco bay area perl user's group was formed to help
bring a sense of community to perl users in the bay area. this is a small
group so far with only 3 members, and we're looking for more dedicated
perl programmers to join us.
here's my off-the-cuff list of objectives for this group-
1) increase network traffic between perl programmers (you know the
benefits of networking, especially in the bay area)
2) keep each other up to date on our areas of perl expertise (i'm a oop
expert, you know sockets like the back of your hand, and you over there
can write a web-crawler in about 30 seconds (15 if you use LWP) )
3) exchange tips and tricks on obsfuscating even the cleanest of code
4) enjoy the fact that we are geeks, and engage in the benefits therein
(i'll leave that to you're imagination)
so, if you're in the bay area, help us form the san francisco bay area
perl users group. get back to me, and lets chat.
thanks-
matt =)
matthew d. p. k. lanier / professional hugger and empath / matt@lanier.org - i web, therefore i am / matt@saturn5.com - i read too many mailing lists / +1-415-505-4450 - i cell way too much / +1-415-863-2932 - i'm never home, but try it anyway /
------------------------------
Date: Tue, 05 May 1998 12:06:39 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: splitting the screen
Message-Id: <354F390F.4CB7256A@matrox.com>
Hi all,
Is there a way (or module) that allows you to split the screen into two
halves.
One half accepts your input, and the other shows the output ...
just like the UNIX talk command?
--
Ala Qumsieh | "How much wood would a woodchuck
ASIC Design Engineer | chuck if a woodchuck could
Matrox Graphics Inc. | chuck wood?"
Montreal, Quebec | - Trivial ... 5!
------------------------------
Date: 05 May 1998 18:48:59 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: splitting the screen
Message-Id: <7xiunkll38.fsf@beavis.vcpc.univie.ac.at>
Re: splitting the screen, Ala <aqumsieh@matrox.com> said:
Ala> Hi all, Is there a way (or module) that allows you to
Ala> split the screen into two halves. One half accepts
Ala> your input, and the other shows the output ... just
Ala> like the UNIX talk command?
the Curses module implements, well, curses ! :-)
tony
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, AT | http://www.vcpc.univie.ac.at/
"You see? You see? Your stupid minds! Stupid! Stupid!" ~ Eros, Plan9 fOS.
------------------------------
Date: Tue, 05 May 1998 16:39:11 GMT
From: edwardj@torvalds.keepthespamthanks.com (Ed Jamison)
Subject: Torvalds.com
Message-Id: <MPG.fb8fc4ec94956d29896d8@news.ais.net>
Anybody want it? I registered this a few weeks back, but I have changed
my mind about a project I was going to use it for, so it is of no use to
me. I will sell it to you for the "list price" of $70. Please e-mail me
if interested.
Thanks,
Edward Jamison
edwardj@torvalds.com
------------------------------
Date: Tue, 5 May 1998 15:36:04 GMT
From: Brent Michalski <perlguy@inlink.com>
To: Lars Chr Hausmann <36haus@but.auc.dk>
Subject: Re: What it perl?
Message-Id: <354F31E4.7990AB0A@inlink.com>
Go to www.perl.com and your quesitons will be answered.
Brent
------------------------------
Date: 5 May 1998 15:54:21 GMT
From: chrish@squonk.net (Chris Hamilton)
Subject: Re: writing to a file
Message-Id: <6incnd$elr$2@duke.squonk.net>
Inge Soetens (soetensi@se.bel.alcatel.be) wrote:
: $tdp_file = "../tdp_arm.txt";
: $test = "Testing ....";
: open (TDPARM, ">$tdp_file")|| die "Can't find article $TDPARM: $!\n"; ;
: print TDPARM $test ;
: close (TDPARM) ;
:
This may or may not be the case, but it's always good to use the FULL path
name of the file you're wanting to open/write to, especially if it's a CGI.
Chris
---
Chris Hamilton C7 F9 1E FF 4F D8 F8 87
chrish@squonk.net F8 13 5F 69 63 B5 EB A8
"You're just jealous because the 'voices' talk to me."
------------------------------
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 2505
**************************************