[7015] in Perl-Users-Digest
Perl-Users Digest, Issue: 640 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 20 14:07:24 1997
Date: Fri, 20 Jun 97 11:00:26 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 20 Jun 1997 Volume: 8 Number: 640
Today's topics:
All New Service for your "Pager" lkjlkj@lkjrlfw.com
arrays <eglamkowski@mathematica-mpr.com>
Re: beautifier for perl code (Clay Irving)
Re: beautifier for perl code <eike.grote@theo.phy.uni-bayreuth.de>
Re: Can't find *** in @INC ....Help Please (A. Deckers)
Re: Case-matching substitution? <usenet-tag@qz.little-neck.ny.us>
Re: Case-matching substitution? <allen@siva.usc.edu>
Content Type <amerar@unsu.com>
Crypt routine (Shawn Laemmrich)
Re: Crypt routine (Nathan V. Patwardhan)
Re: Errornous read/sysread for PC-Perl? <hartje@etech.hs-bremen.de>
Re: Errornous read/sysread for PC-Perl? <hartje@etech.hs-bremen.de>
Re: Llama question (Dan Harper)
Re: Llama question <mvale@vanoise.sps.mot.com>
Makemap and perl DB files (Harold J. Fennell)
mod_perl installation <mdudley@execonn.com>
Re: Output to HTML page (Mary Savage)
Re: Perl 5 regexps as independant package? <usenet-tag@qz.little-neck.ny.us>
Perl 5.003... (John Sanabria)
Re: perlNT and NTMail (Neil Briscoe)
Possible Bug: Multiple DBM Files at once (Henning Schmiedehausen)
print statement question <garye@iname.com>
Re: RFD: comp.lang.perl reorganization <garye@iname.com>
Setting a script's user ID (Chris Talent)
Re: socket programming <psrc@corp.airmedia.com>
Re: Splitting a variable containing filename and extens (Clay Irving)
strftime in perl? <felicity@eclectic.kluge.net>
uc function for PERL4 <pagib@aur.alcatel.com>
Unix/Internet System Manager Position - Muskegon, MI (Theron Wierenga)
URGENT HELP! Need to add function to script <blass@unlinfo.unl.edu>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 20 Jun 1997 16:52:53 GMT
From: lkjlkj@lkjrlfw.com
Subject: All New Service for your "Pager"
Message-Id: <5oech5$j9g@mtinsc02.worldnet.att.net>
ONLY AVAILABLE IN THE:
U.S.A, CANADA VIRGIN ISLANDS, AND PUERTO RICO
BE SURE TO GO TO OUR SITE AND CHECK OUT OUR FREE TRIAL.
Call everyone and tell them to throw away all of your old home, office, fax,
pager, voice-mail, and cellular numbers and give them your New "Virtual Office"
800/888 number! The only number any one will ever need.
Are you tired of giving out all of your different phone numbers to everyone?
Wouldnt it be nice to be able to give everyone just ONE phone number that
will find you anywhere you are? Even out of town, or in a restaurant, or even
on the golf course.
Now you can.
We have the answer to all your communication needs. Its called the "Virtual Office".
And this new service is loaded. It comes with features like:
An automated Call Attendant, Live Call Connect (in real time), Fax Sending, Fax Receiving,
Even without a fax machine! E-Mail Notification and Delivery, Without a PC!,
Outbound calling, Low Cost Long Distance Service, Inbound/Outbound 800/888
Number, Worldwide Call Transfer, Call Forwarding, Call Screening, Full Service Voice
Mail, Nation Wide Pager Notification, Conference Calling, Speed Dialing, Auto Dial,
Auto Messaging, Temporary Greeting, Unavailable Greeting, Password Protection,
Pager Notification, and No Equipment or Software to buy, "Ever".
Priced from $9.95* per month, Plus 10.9 cents per minute per event.
Thats less than one phone line would cost per month.
For more information please visit our web sight:
http://www.mynumber.com
* Based on our best priced plan.
------------------------------
Date: Fri, 20 Jun 1997 11:02:25 -0400
From: the count <eglamkowski@mathematica-mpr.com>
Subject: arrays
Message-Id: <33AA9B81.2C5D@mathematica-mpr.com>
I'm working on converting a C program to perl, and it is not entirely
clear to me, after reading Chapter 4 of Programming Perl, how I should
go about converting the following C data structure into a perl DS:
struct final_disp {
char *label;
int freq[NUM_GROUPS][NUM_TYPES];
}
final_disp is used as an array later on, so I have a two-dimensional
array within an array struct.
Do I need to create the struct before I use (which I suspect I don't'),
or can I create it on the fly? If so, would I do something like:
$final_disp[$i]->$freq->[0][0]++;
where the equivalent C statements would be:
final_disp[i].freq[0][0]++;
I have this nagging suspicion that I should be using an array of
hashes, but I just haven't quite grasped this stuff yet :(
Or maybe it's because I am trying to think too much like C and not
enough like Perl ;)
------------------------------
Date: 20 Jun 1997 10:07:56 -0400
From: clay@panix.com (Clay Irving)
Subject: Re: beautifier for perl code
Message-Id: <5oe2rs$5e0@panix.com>
In <33AA5799.167EB0E7@rocketship.com> Sanjay Varma <sanjay@rocketship.com> writes:
>is there a beautifier for perl code? (written in perl or otherwise)
There are several of them: Tom, Randal, Tod, Mike...
--
Clay Irving See the happy moron,
clay@panix.com He doesn't give a damn,
http://www.panix.com/~clay I wish I were a moron,
My God! Perhaps I am!
------------------------------
Date: Fri, 20 Jun 1997 17:14:47 +0200
From: Eike Grote <eike.grote@theo.phy.uni-bayreuth.de>
Subject: Re: beautifier for perl code
Message-Id: <33AA9E67.2781@theo.phy.uni-bayreuth.de>
Sanjay Varma wrote:
>
> is there a beautifier for perl code? (written in perl or otherwise)
> where can I get one?
Try
http://www.arachnoid.com/lutusp/ftp/cgi/pb.txt
Bye, Eike
--
======================================================================
Eike Grote, Theoretical Physics IV, University of Bayreuth, Germany
----------------------------------------------------------------------
e-mail -> eike.grote@theo.phy.uni-bayreuth.de
WWW -> http://www.phy.uni-bayreuth.de/theo/tp4/members/grote.html
http://www.phy.uni-bayreuth.de/~btpa25/
======================================================================
------------------------------
Date: 20 Jun 1997 15:40:47 GMT
From: deckers@man.ac.uk (A. Deckers)
Subject: Re: Can't find *** in @INC ....Help Please
Message-Id: <slrn5ql93r.kaj.deckers@news.rediris.es>
In <5oai91$21k_004@interaccess.interaccess.com>,
Shelle <shelle@interaccess.com> wrote:
>Having been through all of the manuals, FAQs, and online documents regarding
>Perl on Windows95, I have yet to find a suitable answer for why I get errors
>such as:
>
> Can't locate XXXXX/XXXX.pm in @INC at filename.pl line ##.
That's probably not a very good choice of namespace. ;-)
>Actually I thought I found a couple of solutions but none seemed to solved
>this problem. Suggestions appreciated.
Have you considered the possibility that your script "can't locate
XXXXX/XXXX.pm in @INC at filename.pl line ##"? :-)
Seriously, do you understand what @INC is? It holds a list of
directories which Perl searches for the modules called by your script.
If XXXXX is not one of them, Perl can't find your module XXXX.pm and it
therefore complains that it "can't locate XXXXX/XXXX.pm in @INC at
filename.pl line ##".
In order to get around this problem you should "use lib 'XXXXX';" at
the top of your script. Looks like you need to do some more RTFMing
about "use lib" and @INC.
HTH,
Alain
--
Perl information: <URL:http://www.perl.com/perl/>
Perl archive: <URL:http://www.perl.com/CPAN/>
Perl FAQ: <URL:http://www.perl.com/CPAN/doc/FAQs/FAQ/>
>>>>>>>>>>>>> NB: comp.lang.perl.misc is NOT a CGI group <<<<<<<<<<<<<<
------------------------------
Date: 20 Jun 1997 16:54:23 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: Case-matching substitution?
Message-Id: <5oecjv$g36$1@news.netusa.net>
Posted and mailed.
Stuart Cooper <stuartc@ind.tansu.com.au> wrote:
> ralphwc@mail.auburn.edu (William C Ralph) writes:
> > I'm looking for a case-matching substitute commmand for words in a long
> > string of text.
...
> Here's one <shocking looking and probably bad> way to do it:
...
> I daresay there's something already in Perl or a package to do this stuff
> better; but meanwhile the above is one way of doing it.
See part 6 of the perl FAQ. ("perldoc perlfaq6" with my [5.004]
installation) There is a question and answer for "How do I substitute
case insensitively on the LHS, but preserving case on the RHS?"
Elijah
------
feel free to reinvent the wheel if you really want to, though
------------------------------
Date: Fri, 20 Jun 1997 10:19:00 -0700
From: J Allen <allen@siva.usc.edu>
Subject: Re: Case-matching substitution?
Message-Id: <33AABB84.778FA493@siva.usc.edu>
How about a more general solution?
#!/usr/bin/perl -w
while (<DATA>){
$search = "cat";
$replace = "feline";
s/($search)/if (uc $1 eq $1){uc $replace}
elsif (ucfirst $1 eq $1) {ucfirst $replace}
else {$replace}/iexg;
print;
}
__DATA__
CAT sat on a rat.
Cat sat on a rat.
cat sat on a rat.
produces:
FELINE sat on a rat.
Feline sat on a rat.
feline sat on a rat.
- Joe Allen
joeallen@siva.usc.edu
> : But what happens when someone inputs Cat, or CAT. I don't want to have to
> : type in every variation of every word into my find and replace file. Is
> : there some kind of tag (-i just replaces Cat and CAT with feline instead
> : of Feline and FELINE) that I can use in the substitute operator.
>
> You could put the mapping to the replacement string in a hash:
>
------------------------------
Date: Tue, 17 Jun 1997 23:42:20 -0500
From: Arthur Merar <amerar@unsu.com>
Subject: Content Type
Message-Id: <33A7672C.A84@unsu.com>
Hello,
I also posted this in the CGI group, but I am hoping someone here might
be able to help me.
I have a CGI script that I wrote. In it, I read an HTML document and
dynamically print it to the screen, then I also output a gif generated
by this script.
I cannot seem to get this to work. In order the for HTML to show up, I
need 'Content-type: text/html'. To get the gif to show up, I need
'Content-type: image/gif'.
When I try and use both, the image does not come out. I just get a
bunch of crap.
How can I output different content types within the same page?
Thanks,
Arthur
amerar@unsu.com
http://www.unsu.com
------------------------------
Date: 20 Jun 1997 10:17:34 -0400
From: swlaemmr@mtu.edu (Shawn Laemmrich)
Subject: Crypt routine
Message-Id: <5oe3du$srs@dilbert.tdg.mtu.edu>
Does anyone have a routine that will take an encrypted field (encrypted
with crypt), strip out the salt characters, and encrypt a clear text
password using them?
Basically what I want to do is to be able to take a password out of the
password file, and a clear text password, and see if they match.
Thanks
Shawn
-----------------------------------*-----------------------------------
Shawn Laemmrich <swlaemmr@mtu.edu>
System Administrator Technology Development Group
Michigan Tech University (906)487-1932 OR 7-2981 Fax:(906)487-3185
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.2
mQCNAzLvj+oAAAEEAKZ/MNO8ZJA3VoeTh0o2GLmgfpn5zhxA2pGSLFQduWZNk8g3
JNPprHbUyYU7RVUkRWz4PQyVQFR7dtkXBLTUmLJAtN/ot+HzD2L80/tylkbXbfcf
RA6K7DLfvWOSbnnz2GvbNLSiHp0GsMaXU9ZAkXLHxh8cBjdvmMqq4FJZlEHVAAUR
tCJTaGF3biBMYWVtbXJpY2ggPHN3bGFlbW1yQG10dS5lZHU+
=GYiJ
-----END PGP PUBLIC KEY BLOCK-----
------------------------------
Date: 20 Jun 1997 14:30:19 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Crypt routine
Message-Id: <5oe45r$imp@fridge-nf0.shore.net>
Shawn Laemmrich (swlaemmr@mtu.edu) wrote:
: password file, and a clear text password, and see if they match.
You should probably read the FAQ and search for crypt().
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: Fri, 20 Jun 1997 17:29:23 +0200
From: "Dr. Michael Hartje" <hartje@etech.hs-bremen.de>
Subject: Re: Errornous read/sysread for PC-Perl?
Message-Id: <33AAA1D3.6F08@etech.hs-bremen.de>
Hello Mike,
Mike Stok wrote:
> You might want to do
>
> binmode (INFILE);
>
> Hope this helps,
>
> Mike
>
Yes indeed, this helped a lot!!!!!!!
Thank You very very very much -- it saved a lot of time and thinking
"how stupid is..."
I was working on a procedure to read TEKTRONIX Waveform data files with
perl and putting it with some additional parameters together for input
to GNUPLOT. Now this works. Great!
I have been asked by TEKTRONIX to publish my work after finishing. It
will be done next.
Michael
--
Hochschule Bremen Labor fuer Hochspannungstechnik
Prof. Dr. Michael Hartje Neustadtswall 30; 28199 Bremen
Telefon: +49 421 5905-444 FAX: +49 421 5905-476
mailto:hartje@etech.hs-bremen.de http://www.hs-bremen.de
------------------------------
Date: Fri, 20 Jun 1997 17:31:14 +0200
From: "Dr. Michael Hartje" <hartje@etech.hs-bremen.de>
Subject: Re: Errornous read/sysread for PC-Perl?
Message-Id: <33AAA242.B04@etech.hs-bremen.de>
Mike Stok wrote:
> You might want to do
>
> binmode (INFILE);
>
> Hope this helps,
>
> Mike
>
Yes indeed, this helped a lot!!!!!!!
I was working on a procedure to read TEKTRONIX scope Waveform data files
with perl and putting it with some additional parameters together for
input to GNUPLOT. Now this works. Great!
I have been asked by TEKTRONIX to publish my work after finishing even
to promote the use of perl for this application. It will be done next.
Michael
--
Hochschule Bremen Labor fuer Hochspannungstechnik
Prof. Dr. Michael Hartje Neustadtswall 30; 28199 Bremen
Telefon: +49 421 5905-444 FAX: +49 421 5905-476
mailto:hartje@etech.hs-bremen.de http://www.hs-bremen.de
------------------------------
Date: Fri, 20 Jun 1997 09:01:58 -0500
From: dwharper@ingr.com (Dan Harper)
Subject: Re: Llama question
Message-Id: <jYujEKYf8GA.212@news2.ingr.com>
In article <5obtng$de0@panix2.panix.com>, glm@panix.com says...
<snip>
>The script is as follows. (from page 199)
>
>#!/usr/local/bin/perl5
>print "Enter the list of strings:\n";
>@list = <STDIN>;
>@reverselist = reverse(@list);
>print @reverselist;
>
>The problem in this example is in the input of information. There
>is no end to the list desired.
When I ran this script on a UNIX machine it worked fine with
^d to indicate eof. On my NT4.0 machine I couldn't figure out
what it expected for eof. ^d certainly didn't work. The
port of Perl I'm using on the NT box is based on Perl 4.036
and was done by someone at Intergraph a couple of years ago.
<snip>
Dan Harper
------------------------------
Date: Fri, 20 Jun 1997 16:27:16 +0200
From: Manuel Valente <mvale@vanoise.sps.mot.com>
Subject: Re: Llama question
Message-Id: <33AA9344.3FE6@vanoise.sps.mot.com>
Gilbert Midonnet wrote:
> I'm having a problem with the questions at the end of chapter 3.
> I've searched through deja news. I don't think anybody has asked
> this question in a while :>
>
> The concept is simple. Take some inputted strings and print out the
> list in reverse.
>
> The problem in this example is in the input of information. There
> is no end to the list desired.
Hi ! Does this help ?
while (<STDIN>) {unshift @list,$_};
print @list;
------------------------------
Date: Fri, 20 Jun 97 15:23:39 GMT
From: harold@spectra.net (Harold J. Fennell)
Subject: Makemap and perl DB files
Message-Id: <5oe78n$66k$1@usenet76.supernews.com>
Hello.
I am using the Sendmail implementation of virtusertables. I am doing
multiple step to create the file. I would like to know if I have the
information, only the virtual name and the email address in an hashed db file,
could I just copy that to the virtusertable without having to makemap the
file. This would be so much easier.
I an using sendmail 8.8.5 and Perl 5.003 on a UNIX system.
Thank you for any help.
Harold
-------------------------------------------------------------------------------------
- Harold J. Fennell Phone: 607-693-3304 -
- Advanced Research Labs Fax: 607-693-4250 -
- P.O. Box 56 E-mail: harold@spectra.net-
- Nineveh, NY 13813 -
- Internet Consultant -
-------------------------------------------------------------------------------------
------------------------------
Date: Fri, 20 Jun 1997 12:33:18 -0400
From: Marshall Dudley <mdudley@execonn.com>
Subject: mod_perl installation
Message-Id: <33AAB0CE.3ACC@execonn.com>
I am running a banner exchange which uses a perl file to throw banners.
Since this is taking much more cpu resources than we can afford I am
trying to install the mod_perl in the Apache server. However I am
getting some cryptic error messages and am not sure where to go to from
here.
I have Perl 5.003. I have installed ExtUtils and upgraded the CGI.pm to
version 2.36. I have downloaded and made available Apache 2.0.
The perl Makefile.PL went without a hitch except for one message from
cp:
+ setting C compiler optimization-level to -O2
EXTRA_CFLAGS: -DSOLARIS2
cp: cannot access Constants/Constants.xs
<---------------------------------------
The make went without a hitch.
However the make test is giving a bunch of errors and no hint on what to
do to fix it:
ww2.zanmai.net:/opt/software/etc/apache/mod_perl-0.99>make test
(cd ../apache_1.2.0/src && make CC="gcc";)
(cd modules; \
make CC=gcc AUX_CFLAGS='-O2 -DSOLARIS2
-DSERVER_SUBVERSION=\"mod_perl/0.99\"' RA
NLIB='ranlib')
(cd perl; make CC=gcc AUX_CFLAGS='-I../../regex -O2 -DSOLARIS2
-DSERVER_SUBVERSI
ON=\"mod_perl/0.99\"' RANLIB='ranlib')
Done building module subdirectories
../apache_1.2.0/src/httpd -X -d `pwd`/t &
httpd listening on port 8529
will write error_log to: /tmp/mod_perl_error_log
/usr/sbin/perl t/TEST 0
constants/export....ok
net/api.............ok
net/cgi.............FAILED tests 2-4 <-----------------------------
Failed 3/4 tests, 25.00% okay
net/headers.........ok
net/hooks...........ok
net/http-get........ok
net/http-post.......ok
net/taint...........ok
httpd terminated
Failed 1 test script, 87.50% okay. 3/43 subtests failed, 93.02% okay.
<--------------------
*** Error code 29
make: Fatal error: Command failed for target `run_tests'
<---------------------------------
This is the error log that got written at /tmp/mod_perl_error.log:
[Fri Jun 20 12:17:04 1997] Can't locate CGI/Switch.pm in @INC at
/opt/software/etc/apache/mod_perl-0.99/t/net/perl/cgi.pl line 3.
BEGIN failed--compilation aborted at
/opt/software/etc/apache/mod_perl-0.99/t/net/perl/cgi.pl line 3.
[Fri Jun 20 12:17:04 1997] Can't locate CGI/Switch.pm in @INC at
/opt/software/etc/apache/mod_perl-0.99/t/net/perl/cgi.pl line 3.
BEGIN failed--compilation aborted at
/opt/software/etc/apache/mod_perl-0.99/t/net/perl/cgi.pl line 3.
[Fri Jun 20 12:17:04 1997] Can't locate CGI/Switch.pm in @INC at
/opt/software/etc/apache/mod_perl-0.99/t/net/perl/cgi.pl line 3.
BEGIN failed--compilation aborted at
/opt/software/etc/apache/mod_perl-0.99/t/net/perl/cgi.pl line 3.
hooks_file =
/opt/software/etc/apache/mod_perl-0.99/t/net/perl/../../docs/hooks.
txt (/opt/software/etc/apache/mod_perl-0.99/t/net/perl)
registered cleanup called for /perl/test at
/opt/software/etc/apache/mod_perl-0.99/t/net/perl/test line 25.
TRAPPED: `system $r->content' 'Insecure dependency in system while
running with -T switch at
/opt/software/etc/apache/mod_perl-0.99/t/net/perl/test line 62.'
registered cleanup called for /perl/test at
/opt/software/etc/apache/mod_perl-0. 99/t/net/perl/test line 25.
TRAPPED: `system $r->content' 'Insecure dependency in system while
running with -T switch at
/opt/software/etc/apache/mod_perl-0.99/t/net/perl/test line 62.'
registered cleanup called for /perl/test at
/opt/software/etc/apache/mod_perl-0. 99/t/net/perl/test line 25.
TRAPPED: `system $r->content' 'Insecure dependency in system while
running with -T switch at
/opt/software/etc/apache/mod_perl-0.99/t/net/perl/test line 62.'
registered cleanup called for /perl/test at
/opt/software/etc/apache/mod_perl-0. 99/t/net/perl/test line 25.
TRAPPED: `system $r->content' 'Insecure dependency in system while
running with -T switch at
/opt/software/etc/apache/mod_perl-0.99/t/net/perl/test line 62.'
registered cleanup called for /perl/test at
/opt/software/etc/apache/mod_perl-0. 99/t/net/perl/test line 25.
TRAPPED: `system $r->args' 'Insecure dependency in system while running
with -T switch at
/opt/software/etc/apache/mod_perl-0.99/t/net/perl/taint.pl line 21.'
TRAPPED: `system $ENV{SERVER_SOFTWARE}' 'Insecure dependency in system
while running with -T switch at
/opt/software/etc/apache/mod_perl-0.99/t/net/perl/taint.pl line 26.'
TRAPPED: `system $r->header_in('User-Agent')' 'Insecure dependency in
system while running with -T switch at
/opt/software/etc/apache/mod_perl-0.99/t/net/perl/taint.pl line 32.'
I am at a loss as to what to take a look at. Any assistance would be
greatly appreciated.
Thanks,
Marshall Dudley
------------------------------
Date: Fri, 20 Jun 1997 13:58:48 GMT
From: savage@inetspace.com (Mary Savage)
Subject: Re: Output to HTML page
Message-Id: <B67812D3DD479AB5.D12C9C7BFB607533.30DB05C4D9AE2A08@library-proxy.airnews.net>
On Wed, 04 Jun 1997 22:59:18 GMT, gdaniell@wt.com.au (Graham Daniell)
wrote:
> I have typed this in as ptest.cgi, and done chmod 777 ptest.cgi on
>it. My question is: ...
>How do I call this script from a HTML page in order to get it to
>return the "Howdy World" to the browser?
You need lines in your html file:
<form method=post action="/cgi-bin/ptest.cgi">
<input type=submit name=gsubmit value="Graham's Submit">
</form>
>Any help will be much appreciated.
>
>Graham Daniell
>Perth, Western Australia
>gdaniell@wt.com.au
------------------------------
Date: 20 Jun 1997 16:59:16 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: Perl 5 regexps as independant package?
Message-Id: <5oect4$g3v$1@news.netusa.net>
Chris Thompson <cet1@cus.cam.ac.uk> wrote:
> Is there an independant package implementing perl5-style regular
> expressions that could be incorporated in other programs? It doesn't
> seem to be easy to make one out of the perl5 source itself.
Have you looked at the "Performing Perl pattern matches and substitutions
from your C program" section of the perlembed man page? I have found it
quite helpful expanding the capibilities of procmail.
Elijah
------
got fed up with procmail's limitations
------------------------------
Date: 20 Jun 1997 15:50:00 GMT
From: josanabr@calvin.univalle.edu.co (John Sanabria)
Subject: Perl 5.003...
Message-Id: <5oe8r8$kuh@calvin.univalle.edu.co>
Hi, i have a problem. Why i can't run scripts, with options.
e.g.
#!/usr/bin/perl -w # don't work
#!/usr/bin/perl # work...
obviously i can't see the warn messages, and the others thing.
Thanks for your help.
--
Nos vemos (See you later).
http://calvin.univalle.edu.co/~josanabr
e-mail: josanabr@calvin.univalle.edu.co
Computer Scientist
------------------------------
Date: 20 Jun 1997 17:29:59 GMT
From: neilb@zetnet.co.uk (Neil Briscoe)
Subject: Re: perlNT and NTMail
Message-Id: <memo.19970620182959.38773A@skep.compulink.co.uk.cix.co.uk>
In article <01bc7d03$0c12bde0$166083c1@london22>, jan@virtualf.com (Yanco)
wrote:
> hi all,
> does anybody have any ideas on how to interact ntmail with perlnt ?
> ie config, perl script specifics.
Sounds like you're another candidate for smtp.pl - it'll allow your perl
scripts to talk smtp to any smtp server, of which ntmail is one. Send me
a mail and I'll return the necessary.
Regards
Neil
------------------------------
Date: 20 Jun 1997 14:14:11 GMT
From: henning@chico.franken.de (Henning Schmiedehausen)
Subject: Possible Bug: Multiple DBM Files at once
Message-Id: <5oe37j$peb$1@chico.franken.de>
Ok, I give up. I thought I understand this language. But I have the
following problem, I stumbled over it in perl 5.003 and perl 5.004,
using either NDBM oder DB data bases. This is on a SUN Ultra 1 running
Solaris 2.5.1
Basically I do the following thing:
tie %firsthash, "DB_File", "list of entries", O_CREAT|O_RDWR, 0664)
foreach $i (keys %firsthash)
{
tie %secondhash, "DB_File", "$DATADIR/$i", O_CREAT|O_RDWR, 0664)
[ modify some fields in %secondhash ]
untie %secondhash;
}
untie %firsthash;
though I have to iterate over about 2000 database files, I should never
have more than two database files open at once.
But I run after about 60 ties's (db) or 30 ties's (NDBM) into "Too
many open files". Reproduceable. And fuser tells me, that my program
has indeed 60+ files open with an ulimit of 64. So the computer is
right (bugger :-( )
According to the man page, untie should destroy the database binding
and close the file(s). Why doesn't it do this? What am I doing wrong?
Or is this really a bug in perl?
Is there a way to circumvent this limitation?
Kind regards
Henning
[ P.s.: Please answer also via E-Mail, as I am not a regular reader
of c.l.p.m ]
--
--
Henning Schmiedehausen -- rn@franken.de
Regionalkontakt Nuernberg Kommunikationsnetz Franken e.V.
------------------------------
Date: Fri, 20 Jun 1997 13:41:48 -0400
From: Gary Ebert <garye@iname.com>
Subject: print statement question
Message-Id: <33AAC0DC.547B@iname.com>
Hello all:
I just noticed some strange behavior that I am hoping that someone can
either explain or tell me where to find the answer.
I am using perl 5.002 on an HP-UX 9.00 machine. I have the followin two
print statements
print TEMPFL "\nThere are $modem_counter out of ${MAXDIALINS} modems
being used\n";
and
print TEMPFL "\nThere are ${count} subscribers logged in\n\n";
$moden_counter and $count are initiliazed to 0.
If $modem_counter is still zero at the end of my script I get the
following output:
There are out of 7 modems being used
If $count is still zero at the end of my script I get the following
output:
There are 0 subscribers logged in
I know that if I put $modem_counter in {} then I get the 0 printed out.
Can someone tell me why???
Thanks,
Gary
Also I know that this is poor practice but I _REALLY_ do not have time
to keep up with this news group. Could you kindly cc: any responses to
my e-mail. THANKS a lot!!!!!
--
Gary Ebert Operations Administrator
Voice: (301) 428-2115 Mobile Datacom Corporation
Fax: (301) 428-1004 19540 Amaranth Drive
Pager: (800) 490-7478 Germantown, MD 20875-2126
------------------------------
Date: Fri, 20 Jun 1997 10:56:32 -0400
From: Gary Ebert <garye@iname.com>
Subject: Re: RFD: comp.lang.perl reorganization
Message-Id: <33AA9A20.4112@iname.com>
Hello all:
This sounds like a great idea to me. I for one would love to be able to
read clpm every day but the traffic prohibits me from doing that.
The only constructive criticism that I can add is that it looks like all
of groups have the same moderators. It seems to me that these people
might be bitting off more than they can chew. It might be a good idea
to try and get some help for those people to thin the workload out a
little bit.
Even though I am probably not qualified consider this an application for
me to be a volunteer moderator (specifically for
comp.lang.perl.programmer and or comp.lang.perl.regex)
Thanks for setting the ball in motion!!!!!
Gary
--
Gary Ebert Operations Administrator
Voice: (301) 428-2115 Mobile Datacom Corporation
Fax: (301) 428-1004 19540 Amaranth Drive
Pager: (800) 490-7478 Germantown, MD 20875-2126
------------------------------
Date: Fri, 20 Jun 1997 07:56:12 GMT
From: cdt@teleport.com (Chris Talent)
Subject: Setting a script's user ID
Message-Id: <33aa3661.3911945@news.teleport.com>
I am trying to write a script that will run Netscape Mail's
MTA-list command, then take that output and write up a quick address
book in HTML format. The script works fine when I'm logged in as
root, but it outputs nothing when I'm logged in as anyone else.
I think that the problem is that the MTA-list command needs to
be executed by root - when I run it from the command line as any other
user, I get nothing.
So, the question is: in perl, how can I call the MTA-list
command as root?
------------------------------
Date: Fri, 20 Jun 1997 13:35:44 -0400
From: Paul S R Chisholm <psrc@corp.airmedia.com>
To: David Dougal <ddougal@gte.net>
Subject: Re: socket programming
Message-Id: <33AABF70.26FD@corp.airmedia.com>
David Dougal wrote:
> require "sockets.pl";
Try
require "socket.ph";
(and run h2ph if it's not found) or
use Socket;
(preferred, but will still need socket.ph). --PSRC
------------------------------
Date: 20 Jun 1997 10:02:30 -0400
From: clay@panix.com (Clay Irving)
Subject: Re: Splitting a variable containing filename and extension
Message-Id: <5oe2hm$3vr@panix.com>
In <33A9AEBD.48D7BB28@babylon5fan.corn> Keys <keys@babylon5fan.corn> writes:
>Keys wrote:
>>
>> I am preparing to write a perl script that will have a variable defined
>> with the form /filename.extension and I would like to extract from
>Update: I am trying the following code to do this, but if anyone else
>has a better idea, I would really like to hear it. My concern is
>filenames with non-three-letter extensions will not be parsed
>correctly...
>$path = $ENV{'PATH_INFO'}; #in the form /filename.ext
>$file = substr $path,1; #should be literal filename.ext
>$name = substr $path,1,-4; #should be literal filename
>$type = substr $path,-3; #should be literal ext
Eeew.
Use the File:Basename that's included with Perl 5:
#!/usr/local/bin/perl5.003
use File::Basename;
$somepath = "/some/long/cockamamie/path/file.foobar";
($base,$path,$tail) = fileparse($somepath, '\..*');
print "$path\n";
print "$base\n";
print "$tail\n";
Outputs:
/some/long/cockamamie/path/
file
.foobar
--
Clay Irving See the happy moron,
clay@panix.com He doesn't give a damn,
http://www.panix.com/~clay I wish I were a moron,
My God! Perhaps I am!
------------------------------
Date: 20 Jun 1997 16:32:24 GMT
From: Theo Van Dinter <felicity@eclectic.kluge.net>
Subject: strftime in perl?
Message-Id: <5oebao$qg2$1@bigboote.WPI.EDU>
I'd like to get some formatted date strings (which I'd use strftime() in
C), but I can't seem to find an easy way to do this. Is there one?
Thanks.
------------------------------
Date: Fri, 20 Jun 1997 09:19:23 -0400
From: Bruno Pagis <pagib@aur.alcatel.com>
Subject: uc function for PERL4
Message-Id: <33AA835A.7169@aur.alcatel.com>
I've written a uc (capitalize) function for PERL4.
There is more than one way to do it. Anybody wloud have a better idea ?
sub uc
{
@t = unpack('C*', $_[0]);
$j=0;
foreach $i (@t)
{
if ($i>=97 && $i<=122)
{ $t[$j] = $i -32; }
$j++;
}
return pack('C*', @t);
}
--
-----------------------------------------------------------
Bruno Pagis Phone: (919) 850-5174 Fax: (919) 850-6670
mailto:bruno_pagis@aur.alcatel.com
__
ALC\/TEL 2912 Wake Forest road
Network Systems RALEIGH, NC 27609
-----------------------------------------------------------
------------------------------
Date: Fri, 20 Jun 1997 14:39:12 GMT
From: twiereng@remc4.k12.mi.us (Theron Wierenga)
Subject: Unix/Internet System Manager Position - Muskegon, MI
Message-Id: <33aa95f6.910705@news.novagate.com>
BULLETIN INTERNAL/EXTERNAL
PLEASE POST
TO: All Professional Staff and Placement Agencies
FROM: Emma Burt
Director of Human Resources
DATE: June 20, 1997
RE: Unix/Internet System Manager Position
Muskegon Public Schools has an opening for a Unix/Internet System
Manager. This is a Paraprofessional D level position, 8 hours per
day, 230 days per year. The minimum hourly rate for this position
would be $18.85.
Responsibilities include maintaining the district wide
Internet/connection and services to the network. Will also perform
maintenance upgrades, back-up support, and operating Web/E-mail
server.
Minimum qualifications include 120 semester hours of college credit or
1800 hours of specific training in computers. Bachelor's degree or
higher is desired.
If you are interested in applying for this position, please send a
letter of application and resume including three references to the:
Director of Human Resources
Hackley Administration Building - Room 104
349 W. Webster Ave.
Muskegon, MI 49440
before 3 p.m. on Wednesday, July 2, 1997.
EB:cc
------------------------------
Date: Fri, 20 Jun 1997 09:51:32 -0600
From: Ben Lass <blass@unlinfo.unl.edu>
Subject: URGENT HELP! Need to add function to script
Message-Id: <33AAA701.7259@unlinfo.unl.edu>
I am in urgent need of help to add a function to an already exisitng CGI
perl script. WARNING: I'm not a Perl programmer and only have been able
to understand enough of perl to take scripts others have done and modify
them for our own uses, except for now.
The script will take input from a WWW form (quiz questions), grade the
quiz and produce the results on a web page for the user.
I need to add two things to this script, which follows at the end of
this message. (I can also provide the HTML file of the quiz, if anyone
requires that).
I need to be able to have the results of the quiz (score, percent,
grade) e-mailed to a particular e-mail address. I will also have a text
entry area on the "new" quiz where user will enter their name, and I
need the script to be able to take the name and reproduce it in the
e-mail with the results.
We need to have e-mailed results simultaneous with the results displayed
on the web page, but the users name displayed on the web page is not
necessary.
I've tried to investigate this problem on my own and am lost. I'm not
sure if I need to have certain modules loaded on the server, such as
cgilib.pl or CGI.pm, but I know where to get those and put them on the
server, if that's necessary.
I need a response TODAY (Friday, June 20) if possible. Thanks! You can
reply to this posting, OR, better yet, e-mail me personally
(blass@unlinfo.unl.edu).
Here's the script. I will send the html to anyone who replies if they
need it.
-----------------------
#!/usr/local/bin/perl
# ovpquiz.pl
# Purpose: a simple CGI script to grade an on-line multiple choice
quiz/test
# on the fly.
# By: Qusay H. Mahmoud, k3is@unb.ca
# Date: Sep 17th, 1996.
print "Content-type: text/html\n\n";
print "<HEAD><Title>Thank you</Title></HEAD>";
print "<BODY><H1>Overview Practice Quiz Results</H1>";
print "<hr>";
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
# @pairs = @pairs[0..16];
$count = 0;
foreach $pair (@pairs)
{
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
# if ($value eq "") {
# &blank_info_response;
# }
if ($name eq "ans1") {
if ($value eq "a4") { ++$count; }
}
if ($name eq "ans2") {
if ($value eq "a2") { ++$count; }
}
if ($name eq "ans3") {
if ($value eq "a2") { ++$count; }
}
if ($name eq "ans4") {
if ($value eq "a2") { ++$count; }
}
if ($name eq "ans5") {
if ($value eq "a3") { ++$count; }
}
if ($name eq "ans6") {
if ($value eq "a1") { ++$count; }
}
if ($name eq "ans7") {
if ($value eq "a2") { ++$count; }
}
if ($name eq "ans8") {
if ($value eq "a2") { ++$count; }
}
if ($name eq "ans9") {
if ($value eq "a1") { ++$count; }
}
if ($name eq "ans10") {
if ($value eq "a3") { ++$count; }
}
if ($name eq "ans11") {
if ($value eq "a4") { ++$count; }
}
}
$percent = $count * 9.09;
$grade = " ";
if ($percent >= 95 && $percent <= 100) {
$grade = "A+";
}
elsif ($percent >= 90 && $percent <= 94) {
$grade = "A";
}
elsif ($percent >= 85 && $percent <= 89) {
$grade = "B+";
}
elsif ($percent >= 80 && $percent <= 84) {
$grade = "B";
}
elsif ($percent >= 75 && $percent <= 79) {
$grade = "C+";
}
elsif ($percent >= 70 && $percent <= 74) {
$grade = "C";
}
elsif ($percent >= 65 && $percent <= 69) {
$grade = "D+";
}
elsif ($percent >= 60 && $percent <= 64) {
$grade = "D";
}
elsif ($percent >= 0 && $percent <= 59) {
$grade = "F";
}
print "<br><br>";
print "<b><h2>You scored: $count out of 11</h2>";
print "<h2>Percent: $percent</h2>";
print "<h2>Grade: $grade</h2></b>";
print "<br><br>";
if ($count <= 7) {
print "<b>Study the on-line material and the textbook readings before
you
take the quiz for a grade. If you need help, send me an <A
HREF=\"mailto:%20selek\@unmc.edu\">e-mail.</A></b>"; }
elsif ($count <= 8) {
print "<b>Good job!</b>"; }
elsif ($count >= 9 && $count <= 10) {
print "<b>Congratulations, you did very well!</b>"; }
elsif ($count = 11) {
print "<b>Fantastic! You answered all the questions correctly!</b>"; }
print "<hr>";
print "<center><TABLE BORDER=0 cellpadding=1 cellspacing=15 width=75%>
<TR>
<TD>
<P><A
HREF=\"http://info.unmc.edu/education/College_Nursing/NU399/ovgquiz.html\">Real
Quiz for a Grade</A>
</TD><TD>
<P ALIGN=RIGHT><A
HREF=\"http://info.unmc.edu/education/College_Nursing/NU399/content.html\">Back
to Table of Contents</A>
</TD></TR>
</TABLE></center>";
print "<hr>";
print "© 1996, Qusay H. Mahmoud";
print "</body>";
print "</html>";
--
******************************************
Ben Lass, Instructional Technology Specialist
University of Nebraska-Lincoln, Department of Distance Education
332B NCCE, 33rd & Holdrege
Lincoln, Nebraska, USA 68583-9800
Phone: 402-472-4349 Fax: 402-472-1901 E-mail: blass@unlinfo.unl.edu
------------------------------
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 640
*************************************