[7610] in Perl-Users-Digest
Perl-Users Digest, Issue: 1236 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 27 22:07:38 1997
Date: Mon, 27 Oct 97 19:00:33 -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, 27 Oct 1997 Volume: 8 Number: 1236
Today's topics:
"Connection is busy ... " problem? <jlewis@burly.com>
Re: Browser redirect for MSIE4.0 <flavell@mail.cern.ch>
Re: BUG in WinPerl; OK in Unix Perl (Eric Bohlman)
Re: CGI tools (Martien Verbruggen)
Re: Controlling Decimal Point (Mike Stok)
Re: Controlling Decimal Point <ase@seanet.com>
Re: File name available in -n loops? (Mike Stok)
Re: File name available in -n loops? (Mike Stok)
filehandle storage in class? (Clinton Wong)
How to use Comm.pl from cron or ? <charis@why.net>
HW: contractor to install perl5.004 on AIX (Ian Morgan)
Re: Memory problems - how can I fix? (Ryan)
Re: PDF (Jeremy D. Zawodny)
Re: Perl 5 and here documents <ase@seanet.com>
perl newbie question (Alan Hearn)
Re: Perl Suffix (Was: Can perl be maken to Compiler ins (Jeffrey Drumm)
perl5/nt4.0/iis (Tim Hartzog)
Re: perl5/nt4.0/iis (Jeremy D. Zawodny)
pod2html indhiraa@hotmail.com
Re: Problem posting to perl CGI script <wtansill@erols.com>
Problem with a perl porg/script <sa.zombie@iname.com>
Problems compiling Perl5.004_u1 on Solaris2.6. <arsen@erg.sri.com>
Re: Reading 2D matrix efficiently(the best way?). <osborri@mail.northgrum.com>
Re: Reference to class method (\&{$foo->you}) <robert.hughes@amarest.com>
Re: Year2000 problem with localtime(); (I R A Aggie)
Re: Your opinion on The Perl Journal (TPJ) ? (Faust Gertz)
Re: Your opinion on The Perl Journal (TPJ) ? (Faust Gertz)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 27 Oct 1997 17:33:56 -0800
From: Jeff Lewis <jlewis@burly.com>
Subject: "Connection is busy ... " problem?
Message-Id: <34554104.7CCC@burly.com>
I'm having trouble tracking down why I get a "Connection is busy with
results for another hstmt" error when I run the following code (running
on nt using sql server and perl, including cgi and ole modules):
$q = join ' ', @qlist; ## an array of insert queries that make up
the transaction
$res = $con->execute("begin tran $q commit tran"); ## con is the
db connection
if($msg = $script->dberrCheck("execute q: $q")) ## db error
checking stuff
{ $script->dbError($msg); } ## ''
$res->Close; ## close the res handle
$script->anotherQuery; ## another query to the db, which results in
the 'Connection
## busy ...' error
However if I run the following somewhat similar code (sacrificing my
single transaction), I get no such error:
foreach $q (@qlist) ## an array of insert queries that make up
the transaction
{
$res = $con->execute("begin tran $q commit tran"); ## con is
the db connection
if($msg = $script->dberrCheck("execute q: $q")) ## db error
checking stuff
{ $script->dbError($msg); } ##
''
$res->Close; ## close the res handle
}
$script->anotherQuery; ## another query to the db, which works just
fine
I don't really see why the former code leaves a statement handle open
while the latter does not. Any ideas? Also, any suggestions (sql
server settings?) on how to make the former code work without producing
such an error would be greatly appreciated. Thanks.
Jeff
------------------------------
Date: Mon, 27 Oct 1997 23:05:35 GMT
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Browser redirect for MSIE4.0
Message-Id: <Pine.A41.3.95a.971028000222.59456C-100000@sp071>
On 27 Oct 1997, Jason Gloudon wrote:
> acauth1 (acauth1@swbell.net) wrote:
> : Trying to find a browser redirect script
..
> CGI Redirection headers that should work can be generated using the CGI perl
> module which you can find by searching CPAN on www.perl.com.
I suppose you considered that it was off-topic for
c.l.p.m to mention that this was a dumb idea.
------------------------------
Date: Mon, 27 Oct 1997 21:09:58 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: BUG in WinPerl; OK in Unix Perl
Message-Id: <ebohlmanEIqAsM.KJG@netcom.com>
Pierre Fortin (pfortin@cisco.com) wrote:
: And I just purchased "Cross-Platform Perl" which mentions using binmode
: for CRLF; but not for EOF... I've added "and 0x1A = EOF" (in red ink) at
: the bottom of Page 80. Thanks! It amazes me that MS couldn't think of
: detecting EOF based on... umm... file length?
The use of a control-z as an EOF marker is actually a historical
compatibility thing from the very early days of MS-DOS. It was
incorporated to ease the porting of CP/M programs, which had to rely on an
EOF character because the CP/M directory structure stored file sizes with
only sector-level granularity. All MS-DOS versions since at least 2.0 (at
least 15 years ago) store a proper byte count and don't actually treat
control-z as special, at least no within the filesystem (some of the
utilities may rely on it), but most standard IO libraries still treat it
as an EOF for compatibility with ancient programs.
------------------------------
Date: 28 Oct 1997 01:23:18 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: CGI tools
Message-Id: <633eq6$8p8$1@comdyn.comdyn.com.au>
In article <62u9gq$qhj$3@nntp2.ba.best.com>,
Zenin <zenin@best.com> writes:
> If you are looking for super speed, flexibility, and portability, I
> _highly_ recommend running Apache on a Unix server with (at the vary
> least) the mod_perl extentions. Apache is the king of web servers,
> and when combined with mod_perl (even better with ApacheDBI too, if
> you're using a database) it's an _extremely_ hard package to beat.
<OffTopic parameter=apology>
If you're looking for super speed, you probably shouldn't be using
perl. Something compiled would most likely be better (C, C++). Perl
is likely to be more portable, although you could of course write
standard C and not use system dependent calls, and use the gnu c
compiler on almost every platform.
This mainly applies to sites that get lots and lots of hits (I am
talking BIG numbers here, not just a few a second). Apache with
mod_perl probably will do for most of the sites out there.
Besides, on the issue of portability and flexibility: I don't think
that commiting yourself to one webserver only is very portable or
flexible. CGI apps shouldn't rely too much on a server implementation.
</OffTopic>
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Begin at the beginning and go on till
Commercial Dynamics Pty. Ltd. | you come to the end; then stop.
NSW, Australia |
------------------------------
Date: 28 Oct 1997 01:25:56 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Controlling Decimal Point
Message-Id: <633ev4$fpn@news-central.tiac.net>
In article <34551325.4351875@news.demon.co.uk>,
<mail@net-workshop.demon.co.uk> wrote:
>I'm writing a Perl script that adds the prices of goods that have been
>ordered using a on-line form. How do I control the number of digits
>after the decimal point (eg, I'm getting such figures as
>139.6999999997 but only want 139.70).
The simple answer which can be found in the FAQ - (frequently asked
questions ... and answers to them) which is linked to at
http://www.perl.com/ - is to use sprintf which will be familar to C
programmers.
You might want to think about how perl represents numbers - usually as
double precision floating point numbers - and make sure that you aren't
dealing with sums of money where you run out of precision for the pennies.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: Mon, 27 Oct 1997 17:27:10 -0800
From: "Allen Evenson" <ase@seanet.com>
Subject: Re: Controlling Decimal Point
Message-Id: <633f0o$344@q.seanet.com>
perldoc -f printf will lead you to......oops almost spoiled it for =
ya :-)
mail@net-workshop.demon.co.uk wrote in article =
<34551325.4351875@news.demon.co.uk>...
>Controlling Decimal Point
>
>Hi,
>
>I'm writing a Perl script that adds the prices of goods that have been
>ordered using a on-line form. How do I control the number of digits
>after the decimal point (eg, I'm getting such figures as
>139.6999999997 but only want 139.70).
>
>Hope someone can help,
>
>Regards
>
>
Richard.
----------------------
Allen S. Evenson <ase@seanet.com>
------------------------------
Date: 28 Oct 1997 01:32:02 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: File name available in -n loops?
Message-Id: <633fai$g2j@news-central.tiac.net>
In article <6337gi$a60$1@news1.bu.edu>,
John Siracusa <macintsh@cs.bu.edu> wrote:
>Is the name of the current file available in commands like this?
>
> perl -ne 'print if(/foo/)' file1
>
>It's not in @ARGV, apparently. I ask because find is so horrible at
>finding files that contain a string. Yes, I know about find2perl,
>and yes I know I should just write a script called pfind or
>something, but I don't want to lug around custom scripts if I can do
>the same thing with just find and perl. Trying to get "{}" to
>interpolate inside the perl part of a "find . -exec perl ..." command
>is a nightmare in most shells.
You'll find it in $ARGV e.g
bash$ perl -ne 'print "$ARGV ($.): $_" if /and/' *.pl
pipe.pl (5): use IO::Handle;
pipe.pl (12): $to{$shell} = new IO::Handle;
pipe.pl (13): $from{$shell} = new IO::Handle;
pipe.pl (21): foreach my $command ('date',
pipe.pl (27): print $to "$command\n";
pipe.pl (30): print "$shell: $command -> $response\n";
server.pl (68): scalar localtime, " and you said '$line'\n";
The perlop man page says:
[...] The @ARGV array is then processed as a
list of filenames. The loop
while (<>) {
... # code for each line
}
is equivalent to the following Perl-like pseudo code:
unshift(@ARGV, '-') unless @ARGV;
while ($ARGV = shift) {
open(ARGV, $ARGV);
while (<ARGV>) {
... # code for each line
}
}
except that it isn't so cumbersome to say, and will
actually work. It really does shift array @ARGV and put
the current filename into variable $ARGV. [...]
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: 28 Oct 1997 01:38:22 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: File name available in -n loops?
Message-Id: <633fme$gcl@news-central.tiac.net>
In article <633fai$g2j@news-central.tiac.net>,
Mike Stok <mike@stok.co.uk> wrote:
>bash$ perl -ne 'print "$ARGV ($.): $_" if /and/' *.pl
That's a dumb example as $. doesn't get reset each script unless you use
eof e.g.
bash$ perl -ne 'print "$ARGV ($.): $_" if /and/; close ARGV if eof' *.pl
pipe.pl (5): use IO::Handle;
pipe.pl (12): $to{$shell} = new IO::Handle;
pipe.pl (13): $from{$shell} = new IO::Handle;
pipe.pl (21): foreach my $command ('date',
pipe.pl (27): print $to "$command\n";
pipe.pl (30): print "$shell: $command -> $response\n";
server.pl (36): scalar localtime, " and you said '$line'\n";
Sorry,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: Tue, 28 Oct 1997 01:18:45 GMT
From: clintdw@netcom.com (Clinton Wong)
Subject: filehandle storage in class?
Message-Id: <clintdwEIqMB9.I8E@netcom.com>
Anyone know of a good way for a class (package) to internally keep a
filehandle? For now, I do this:
$self->{'file'} = \*FH;
And when people want to play with the filehandle, they need to call this:
sub get_fh {
my ($self) = @_;
local *FH = $self->{'file'};
return \*FH;
}
There's gotta be a better way... The Sockets.pm module seemed to
handle this nicely but I didn't find much when I went poking
around in there. Ideas?
Clinton
------------------------------
Date: Mon, 27 Oct 1997 18:05:39 -0600
From: Jim Sauber <charis@why.net>
Subject: How to use Comm.pl from cron or ?
Message-Id: <34552C53.47C2@why.net>
I've tried every trick I can think of, but have been unable to get an
app that uses Comm.pl to run in the background or from the cron. This
app talks to a very unsophisticated database. (No problem running it in
the foreground.) If it can't be done using Comm.pl any other hints? Any
help at all would really be appreciated.
Thanks
Jim Sauber
jsauber@nortel.ca
------------------------------
Date: Mon, 27 Oct 1997 21:55:04 -0600
From: weiqi@pipeline.com (Ian Morgan)
Subject: HW: contractor to install perl5.004 on AIX
Message-Id: <weiqi-2710972155050001@ip39.austin8.tx.pub-ip.psi.net>
Please contact me at weiqi@pipeline.com if you or your firm
would consider contracting to install perl5.004 and a matched
version of perlTk.
--
Gala Weiqi -- Ian Morgan of Zapata Texas
------------------------------
Date: Tue, 28 Oct 1997 00:40:12 GMT
From: wwolfe@netcom.com (Ryan)
Subject: Re: Memory problems - how can I fix?
Message-Id: <wwolfeEIqKJ1.Lvn@netcom.com>
Tom Phoenix (rootbeer@teleport.com) wrote:
: On Mon, 27 Oct 1997, Ryan wrote:
: > I realise that perl can't free() up a block of memory back to the
: > OS, but shouldn't perl be able to reuse memory it's already allocated?
: It can and does reuse memory, with one notable exception (unreachable
: circular data structures). If you find other situations in which it fails
: to re-use reclaimable memory, please file a bug report with perlbug.
: Thanks!
for a much simpler approach to my more complex "need".
------
$var = "KEY";
$hash{KEY} = "data";
foreach (1..100000) {
$hash{$_} = $hash{$var};
delete($hash{$var});
$var = $_;
}
@keys = keys %hash;
print "key count: $#keys\n";
print "data: $hash{$var}\n";
------
$#keys equals 0 as it should and the value of $hash{$var} when the loop
is done is "data" as it should be. but this baby takes up 14megs in memory.
IF I have a hash that isn't really "growing" why would it take up so much
memory?
I thought perl would mark the block "free'ed" by delete() as reusable
and allow the hash to regrow into that already allocated block. yet
it's not, it's realloc'ing more and more memory.
Should it do that?
Ps: i realise the key size of the hash IS growing in size, so umm... can
i maybe fix this by padding the key? is that why perl isn't able to
reuse the block allocated already?
-Ryan
: --
: Tom Phoenix http://www.teleport.com/~rootbeer/
: rootbeer@teleport.com PGP Skribu al mi per Esperanto!
: Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
: Ask me about Perl trainings!
------------------------------
Date: Tue, 28 Oct 1997 13:11:12 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: PDF
Message-Id: <3456e40f.116788613@woody.wcnet.org>
[original author automagically cc'd via e-mail]
On Mon, 27 Oct 1997 15:38:27 -0800, Tom Phoenix
<rootbeer@teleport.com> wrote:
>On 27 Oct 1997, Charles Thayer wrote:
>
>> Any PDF generators or readers in Perl around? /charles
>
>If there's a module which does what you want, it should be listed in
>the module list on CPAN. If you don't find one to your liking, you're
>welcome and encouraged to submit one! :-) Hope this helps!
'cmon Tom, what makes you think that only a module would do this?
Someone may have developed a Perl script that is capable of writing
basic PDF files. It may not use any modules at all, and it may not be
on CPAN, 'cause the author hadn't thought of putting it there...
Just a few extra cents thrown in. :-)
Jeremy
--
Jeremy D. Zawodny jzawodn@wcnet.org
Web Server Administrator www@wcnet.org
Wood County Free Net (Ohio) http://www.wcnet.org/
------------------------------
Date: Sun, 26 Oct 1997 21:09:25 -0800
From: "Allen Evenson" <ase@seanet.com>
Subject: Re: Perl 5 and here documents
Message-Id: <633f0l$344@q.seanet.com>
=20
Steve Walker wrote in article <630lhr$ad2@news.onramp.net>...
>I'm having problems with a script that uses lots of here documents. I =
keep=20
>getting the error:
>
> Can't find string terminator " end_of_html" anywhere before EOF =
at =20
>class_ad_test.cgi line 905.
>
>But the terminator IS there...here is a snippet of code that gives an=20
>error:
>
> print <<" end_of_html";
the space between " and the end_of_html line are doing it to you
get rid of the space or maybe change them to underscores: like
print <<"__end_of_html";
<HTML>
blah
blah
__end_of_html
.. The here doc end marker must start at beginning of line and EXACTLY =
match
what you said the end marker would be...
[snipped inline text from posters heredoc]
> end_of_html
> exit;
>
>I've tried various terminators with and without leading spaces =
(indents)=20
>and none work.
>
[snip]
>Arrggghhhhh!
>
>Any ideas?
page 43-44 of the "Programming Perl" (2nd Edition) Explain it pretty =
well. ;-)
-------------------------------------
Allen S. Evenson
------------------------------
Date: 28 Oct 1997 01:23:27 GMT
From: hearn@sun-fde3.daldd.sc.ti.com (Alan Hearn)
Subject: perl newbie question
Message-Id: <HEARN.97Oct27192327@sun-fde3.daldd.sc.ti.com>
I want to get a list of files to process.
I tried the following:
open(FILE_LIST, "ls | grep -v bak |");
but FILE_LIST is empty. I thought this would work based on my PERL book
showing the following example:
open(FIND, "find . -print |");
but this does not work either. Am I doing something wrong? Any help
(email please as I do not use this newsgroup much... yet!) would be
greatly appreciated.
thanks,
Alan S. Hearn MSG: GMBL M/S 8650
Texas Instruments Phone: 972-480-2726
Dallas, Texas Email: hearn@daldd.sc.ti.com
--
thanks,
Alan S. Hearn MSG: GMBL M/S 8650
Texas Instruments Phone: 972-480-2726
Dallas, Texas Email: hearn@daldd.sc.ti.com
------------------------------
Date: Tue, 28 Oct 1997 01:09:32 GMT
From: drummj@mail.mmc.org (Jeffrey Drumm)
Subject: Re: Perl Suffix (Was: Can perl be maken to Compiler instead of interpreter?)
Message-Id: <345534f0.83557198@news.mmc.org>
On Mon, 27 Oct 1997 10:11:14 +0100, Doug Seay <seay@absyss.fr> wrote:
>Do most people put .pl at the end of perl filenames? Am I the odd man
>out here? I'd understand that for folks trapped in a 8.3 filename
>system or filetype baseed OS, but do people do that who use modern OSes?
>
>- doug
Well, I put extensions on all my source. When I compile them, the
extensions get lopped off (at least, on the Unix-based systems). Some
day I'll get around to trying out the Perl Compiler . . .
I'm one of those folks that has a foot in both graves (really mangled
a metaphor there, hmmm), working in both AIX and NT. Extensions make
moving stuff between boxes a little easier . . . since NT looks for
the file association by extension, I don't have to think twice about
it.
Also makes it little easier to locate all the Perl applications strewn
about the file system on the Unix box, on the rare occasion I have to
do it.
--
Jeffrey R. Drumm, Systems Integration Specialist
Maine Medical Center Information Services
420 Cumberland Ave, Portland, ME 04101
drummj@mail.mmc.org
------------------------------
Date: 28 Oct 1997 00:13:02 GMT
From: thartzog@nfinity.com (Tim Hartzog)
Subject: perl5/nt4.0/iis
Message-Id: <633ame$q7a@news.nfinity.com>
Hi all,
I just tried to get Perl5 installed on an NT4.0 server running IIS 2.0 and
can't seem to get it to work with a browser. I have configured NT to run perl
with the .pl extension. What the heck am I missing? I got it to work on a 95
machine running personal web server.
Thanks in advance for any help.
Tim
------------------------------
Date: Tue, 28 Oct 1997 13:13:06 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: perl5/nt4.0/iis
Message-Id: <3457e4bd.116962433@woody.wcnet.org>
[original author automagically cc'd via e-mail]
On 28 Oct 1997 00:13:02 GMT, thartzog@nfinity.com (Tim Hartzog) wrote:
>I just tried to get Perl5 installed on an NT4.0 server running IIS 2.0 and
>can't seem to get it to work with a browser. I have configured NT to run perl
>with the .pl extension. What the heck am I missing? I got it to work on a 95
>machine running personal web server.
Two thoughts:
(1) Upgrade your IIS to 3.0. It's more secure and reliable.
(2) Have you enabled Execute permission on your /cgi-bin virtual root?
Jeremy
--
Jeremy D. Zawodny jzawodn@wcnet.org
Web Server Administrator www@wcnet.org
Wood County Free Net (Ohio) http://www.wcnet.org/
------------------------------
Date: Mon, 27 Oct 1997 19:01:28 -0600
From: indhiraa@hotmail.com
Subject: pod2html
Message-Id: <877999952.27595@dejanews.com>
Hi ,
I am having a small problem in generating HTML doc. from a pod. document.
Here is what I have.
=head1 HEADING
SingleMethods
=begin html
<a href=www.foo.com> Junk </a>
=end html
=cut
The problem is pod2html replaces the "<" and ">" characters by "<" and
">" respectively. But I want it to appear as HTML tags, that's why I am
using "begin html" and "end html", but it seems to interpret the HTML
tags inside the block =begin html/=end html.
Am I doing something wrong.
Any suggestions..
Thanks.
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Mon, 27 Oct 1997 21:22:34 -0500
From: "William B. Tansill, III" <wtansill@erols.com>
Subject: Re: Problem posting to perl CGI script
Message-Id: <34554C6A.69D2@erols.com>
Bruce A. Head wrote:
>
> I have been using a perl script that accepts a query from an HTML form
> using the POST method, looks up the query in a text file and then
> returns the data to the browser. The script was working fine for about
> a month but now suddenly no longer works properly.
>
> The script now returns an error message that no matches were found. It
> appears as if the query term sent to the HTML form is not being passed
> to the script, as there are several places in the HTML output where the
> query term should appear and these are blank.
>
> The file permissions on the files appears to be correct. I can't figure
> this out. I've recently installed several other cgi programs (including
> RealAudio server, a conference board program and a chat program). I'm
> suspecting one of these is the problem...
>
> I'm using perl 4.0 on UNIX BSD. Any ideas what the problem could be?
>
> Bruce Head
Post code so we can take a look.
--
How do I set my laser printer to "stun"?
------------------------------
Date: 28 Oct 1997 01:21:20 GMT
From: "bob jones" <sa.zombie@iname.com>
Subject: Problem with a perl porg/script
Message-Id: <01bce33f$60c50260$0700a8c0@slave>
I havn't been using perl all that long, but I can't seam to find any bug in
the code that gives me an error. When i run it localy, it is fine, but
over unix server, has errors.
Here is the source
#!/usr/bin/perl
############################################################################
##
# Clan Kill Count Script Version 1.0 rev A
#
# Copyright 1997 BoB Eh? Productions Hounds@serve.com
#
# Created 11/08/97 Last Modified 21/08/97 5:00pm (EST)
#
# Script use only by mail authorization from the author
#
############################################################################
##
# COPYRIGHT NOTICE
#
# Copyright 1997 BoB Eh? Productions All Rights Reserved.
#
#
#
# Obtain permission before using this software on the Internet or in any
#
# other medium. In all cases copyright and header must remain intact.
#
############################################################################
##
# Last change: B.E.P.
# Revisions list
# Um... None
##############################################################
# == USER VARIABLES ==
$playerlsthome = '/home/serve/Hounds/cgi-bin'; #home of the clanlist
$playerlist = 'player.lst'; #list of all clan data
$resultpage = 'kb1.html'; #the roster of the clan
$direc = '/home/serve/Hounds'; #place to put result page
$clanpic = 'Ghostb.gif'; #clan logo (can be any
picture
$elitepic = 'elite.jpg';
$regulatpic = 'regular.jpg';
$greenpic = 'green.jpg';
$cadetpic = 'cadet.jpg';
# == MAINLINE PROGRAM ==
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
# Split the name-value pairs
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
# Un-Webify plus signs and %-encoding
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s/<!--(.|\n)*-->//g;
$FORM{$name} = $value;
}
open (FILE, "$playerlist" ) || die "Can't open the member data file.";
@clandata = <FILE>;
close FILE;
$clandfile = @clandata;
for ($i=0;$i<$clandfile;$i++) {
$test = $clandata[$i];
@memdata = split (/.,./, $test);
if ($FORM{'killer'} eq $memdata[0])
{$memdata[1] = $memdata[1] + $FORM{'killerk'};
@clandata[$i] = "$memdata[0].,.$memdata[1]\n";}
}
open (FILE , ">$playerlist" ) || die "Can't open the member data file.";
for ($i=0;$i<$clandfile;$i++)
{print FILE "$clandata[$i]";}
close FILE;
open (FILE, "$playerlist" ) || die "Can't open the member data file.";
@clandata = <FILE>;
close FILE;
$clandfile = @clandata;
open (ROST, ">$resultpage") || die "Can't open the output roster page.";
print ROST "<HTML><HEAD><TITLE>Clan Roster</TITLE></HEAD>\n";
print ROST '<body bgcolor="#000000" text="#0000FF" link="#008000">';
print ROST '<p align="center"><img src="';
print ROST "$clanpic";
print ROST '"width="226"';
print ROST 'height="219"></p>';
print ROST '<p align="center"><font size="7"><u>Kill Board</u></font></p>
<p align="center">This is a record of all kills accomplised in all wars,
and fights.</p> <div align="center"><center>';
print ROST '<table border="3" width="50%">';
print ROST "<tr>\n";
print ROST '<td><p align="center"><font size="4">Warrior';
print ROST '</font></p>';
print ROST "</td>";
print ROST '<td><p align="center"><font size="4">Kills';
print ROST '</font></p>';
print ROST "</td>";
print ROST '<td><p align="center"><font size="4">Rating</font></p></td>';
print ROST "</tr>\n";
for ($i=0;$i<$clandfile;$i++) {
$test = $clandata[$i];
@memdata = split (/.,./, $test);
print ROST "<tr>\n";
print ROST '<td><p align="center">';
print ROST "$memdata[0]";
print ROST '</p></td>';
print ROST '<td><p align="center">';
print ROST "$memdata[1]";
print ROST '</p></td>';
if ($memdata[1] >= 100)
{print ROST '<td><p align="center">Elite - <img src="';
print ROST "$elitepic";
print ROST '"width="50" height="10"> </p>';}
elsif ($memdata[1] >=50 && $memdata[1] <100)
{print ROST '<td><p align="center">Regular - <img src="';
print ROST "$regularpic";
print ROST '"width="50" height="10"> </p>';}
elsif($memdata[1] >=1 && $memdata[1] <50)
{print ROST '<td><p align="center">Green - <img src="';
print ROST "$greenpic";
print ROST '"width="50" height="10"> </p>';}
else
{print ROST '<td><p align="center">Cadet - <img src="';
print ROST "$cadetpic";
print ROST '"width="50" height="10"> </p>';}
print ROST "</tr>\n";
} #while
print ROST "</table></body></html>\n";
close ROST;
exit;
Thanks to all and to all a good night.
Bob
------------------------------
Date: Mon, 27 Oct 1997 16:04:34 -0800
From: Tom Arseneault <arsen@erg.sri.com>
Subject: Problems compiling Perl5.004_u1 on Solaris2.6.
Message-Id: <34552C12.3B34@erg.sri.com>
I downloaded a virgin latest.tar.gz file, unziped/tared it, ran
Configure, ran make depend and got the following errors on every file it
tried:
/usr/local/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2.2/include/sys/param.h:187:
warning: `NBBY' redefined
/usr/include/sys/select.h:45: warning: this is the location of the
previous definition
In file included from /usr/include/sys/stream.h:26,
from /usr/include/netinet/in.h:38,
from perl.h:361,
from pp_sys.c:2:
/usr/include/sys/model.h:32: #error "No DATAMODEL_NATIVE specified"
Finding dependencies for regcomp.o.
In file included from perl.h:223,
from regcomp.c:2:
____________________________
Here is my enviorment:
setenv LD_LIBRARY_PATH
$OPENWINHOME/lib:/usr/lib:/usr/local/lib:/usr/local/lib/mh:~arsen/sparcsolaris/lib
set path = ( /usr/ccs/bin ~/bin/$ARCHITECTURE ~/bin
\
/usr/bin /usr/etc /bin
\
/usr/local/bin /usr/local/etc
\
/usr/local/bin/mtools /usr/local/bin/metamail
\
/usr/project/facility/actionmail/bin /usr/local/bin/mh
\
$OPENWINHOME/bin /usr/local/X.V11R5/bin
\
$FMHOME/bin $IOFFICE/bin $WINGZ/bin
\
$FILTRIX/sun4 $LIKEN $AUTOPLAN_HOME
\
$SYBASE/bin $SYBASE/local/bin
\
$OPNET/sys/bin $JETADMIN
\
$GUIDEHOME/bin /antelope/a/SUNWconn/snm/bin
\
/opt/SUNWconn/bin /opt/apunix/scanner/bin
\
/usr/ucb )
---------------------------------
My shell is csh and the machine is a Sparc20.
I have seen this error message on other things I have tried to compile
but 2.6 was not important so I just compilied on 2.5 and went on with
life but we are moving all our servers to 2.6 and I need a solution.
Thanks in advance for any help.
Tom Arseneault
------------------------------
Date: Mon, 27 Oct 1997 21:38:32 -0500
From: Rick Osborne <osborri@mail.northgrum.com>
Subject: Re: Reading 2D matrix efficiently(the best way?).
Message-Id: <34555028.5CBA4340@mail.northgrum.com>
Jong wrote:
> I am trying to read in a 2D matrix as follows into a hash.
> %hash={ AA, 4, AR, -1,,,,, etc };
> So that I would get a pair AA=4, another pair AT=0, etc.
> Is there a known way of doing it fast?
> A R N D ...
> A 4 -1 -2 -2 ...
> R -1 5 0 -2 ...
[[[ Array snipped for the most part ]]]
Why not:
my %hash;
my $line = <STDIN>; #read in column names
chomp($line); #remove \n
my @columns = split($line); #split on whitspace by default
my @values;
my $row;
my $col;
my $value;
while($line = <STDIN>) { #keep going until EOF
chomp($line); #remove \n
@values = split($line); #again, split on white space
$row = shift(@values); #get the name of the row
for($col = $[; $col <= @colums; $col++) {
$hash{$columns[$col] . $row} = $values[$val];
}
}
Granted, this is just *how* to do it. This could be very much
streamlined.
-- Rick Osborne
"Evil! Evil! I'm beside myself with evil!"
------------------------------
Date: Mon, 27 Oct 1997 17:56:40 -0800
From: Robert Hughes <robert.hughes@amarest.com>
Subject: Re: Reference to class method (\&{$foo->you})
Message-Id: <34554658.59BBF9C4@amarest.com>
Don Thomson wrote:
>
> Hmmmm..... I'm trying to create a reference to a class method, as in
> '\&{$foo->you}' in the following code snippet. This works, but it also
Try something like this:
my $sub = *{$foo.'::you'}{'CODE'};
I am using very similar code to retrive and store a referance to a
subroutine. It should return undef if the routine does not exist. This
is fairly straight from one of the perl man pages on GLOB referances,
(forget which.... sorry :-)
--
Robert
------------------------------
Date: Mon, 27 Oct 1997 21:37:51 -0400
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Year2000 problem with localtime();
Message-Id: <-2710972137520001@aggie.coaps.fsu.edu>
In article <B07A7842-D1286@144.3.128.40>, "Gary Trachier"
<trachier@crrel.usace.army.mil> wrote:
+ Followup on my test program...
+ Well folks, it really does work correctly.
Well, yes, it does. If you had consulted the man page on localtime(),
you would have seen this [included for anyone without access to said
man page]:
Declarations of all the functions and externals, and the tm structure,
are in the time.h header file. The structure declaration is:
struct tm {
int tm_sec; /* seconds after the minute - [0, 61] */
/* for leap seconds */
int tm_min; /* minutes after the hour - [0, 59] */
int tm_hour; /* hour since midnight - [0, 23] */
int tm_mday; /* day of the month - [1, 31] */
int tm_mon; /* months since January - [0, 11] */
int tm_year; /* years since 1900 */
Hmmm...years since 1900...hmmm...and no range like [0-99]...hmmm...
int tm_wday; /* days since Sunday - [0, 6] */
int tm_yday; /* days since January 1 - [0, 365] */
int tm_isdst; /* flag for alternate daylight */
/* savings time */
};
James - things that make you say "hmmm"
--
Consulting Minister for Consultants, DNRC
Support the anti-Spam amendment <url:http://www.cauce.org/>
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>
------------------------------
Date: Tue, 28 Oct 1997 03:54:14 GMT
From: faust@wwa.com (Faust Gertz)
Subject: Re: Your opinion on The Perl Journal (TPJ) ?
Message-Id: <345758c4.6302369@news.wwa.com>
On 27 Oct 1997 07:58:46 GMT, sb@en.muc.de (Steffen Beyer) wrote:
>> What do you like best about the Perl Journal?
>
>The stories you wouldn't hear about otherwise, for instance the article
>"Perl and the Human Genome Project".
Actually, you can find some of the articles from the Perl Journal in
other sources. Lincoln Stein's "How Perl Saved the Human Genome
Project" appeared in the Spring 1997 issue of _Dr. Dobb's Journal_
(http://www.ddj.com/ddj/1997/1997.careers/stei.htm) and was presented
at the O'Reilly Perl Conference (http://conference.perl.com/) I also
believe I saw Lincoln's articles entitled "The Mangler" an "Rating Web
Page Tastefulness" in another periodical. Perhaps in _Web
Techniques_? I could be wrong.
Streben nach Wahrheit
Faust Gertz
Philosopher at Large
"Two things fill the mind with ever new and increasing admiration and
awe, the oftener and the more steadily we reflect on them: the starry
heavens above and the moral law within. I have not to search for them
and conjecture them as though they were veiled in darkness or were in
the transcendent region beyond my horizon; I see them before me and
connect them directly with the consciousness of my existence." --
Immanuel Kant, _The Critique of Practical Reason_
------------------------------
Date: Tue, 28 Oct 1997 03:54:57 GMT
From: faust@wwa.com (Faust Gertz)
Subject: Re: Your opinion on The Perl Journal (TPJ) ?
Message-Id: <34565817.6129575@news.wwa.com>
On 26 Oct 1997 20:02:31 GMT, as646@FreeNet.Carleton.CA (John Robson)
wrote:
>I would like to hear your opinions on it.
Ok.
>Do you find it useful?
Yes. Very useful.
>Is it slanted toward the beginner or the expert, or both?
I think it started with more articles for beginners, but has shifted
away from such articles (I guess "Just the FAQs" is suppose to fill
that role now). If you are a beginner, you really should order all
the back issues. That way you will have access to Lincoln Stein's
earlier CGI articles, Jeffrey Friedl's Regular Expression articles,
and various articles on perl and Usenet, Mail, etc . . . If you
aren't a beginner, you should get all the back issues anyway, 'cause
they are so good.
>Does it have only Perl code, or does it also have fun anecdotal
>stories about how people use Perl creatively?
Thanks god it isn't all about coding. It has both. I really enjoyed
the articles on the Human Genome Project, Pairwise Voting, Nuclear
Weapons, etc. . . Don't get me wrong, I find the code valuable as
well, but it is the perl interest articles that keep me excited about
learning perl.
>What do you like best about the Perl Journal?
The excitement whenever I get a new copy. Yes, I have become a geek.
I read it from cover to cover (except for the Perl/TK articles) and I
know that someday, when I read and understand all the articles
clearly, I will finally have left the position of perl newbie and be
well on my way to amateur perl enthusiast.
Streben nach Wahrheit
Faust Gertz
Philosopher at Large
"Do not fear mistakes - - there are none." - Miles Davis.
------------------------------
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 1236
**************************************