[7888] in Perl-Users-Digest
Perl-Users Digest, Issue: 1513 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Dec 20 13:08:15 1997
Date: Sat, 20 Dec 97 10:00:22 -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 Sat, 20 Dec 1997 Volume: 8 Number: 1513
Today's topics:
100.90 NOT 100.90000000000000568 HELP <design@kiwi.net>
Re: 100.90 NOT 100.90000000000000568 HELP (Mike Stok)
Re: 100.90 NOT 100.90000000000000568 HELP <erik@mmm.uni-c.dk>
csh ==> perl? <pete@isis.spa.umn.edu>
Re: Downloading ALL CPAN Modules? (Honza Pazdziora)
Re: embare-assed newbie Q (Bart Lateur)
Re: embare-assed newbie Q ushere@ibm.net
Re: embare-assed newbie Q <ebohlman@netcom.com>
Re: getting directory size (Honza Pazdziora)
Re: Help on accessing the cgi-bin directory <tjbiuso@redrose.net>
Re: Help with pattern matching please? (Bart Lateur)
Re: hey guyz! plz help me out! (Bart Lateur)
Re: How do i process a variable length array (Tad McClellan)
HTML File <cybercom@pacific.net.sg>
Re: Perl 5 syntax (Chip Salzenberg)
Re: Perl editor needed (Jeff R. Stone)
Re: printing quotes with print command (Tad McClellan)
Read in Mailfolder (Puck)
Re: Regular Expression Question - non greedy match (Honza Pazdziora)
Re: Restricting CGI Programs to Perl. (Scott Howard)
Re: Statistics for comp.lang.perl.misc (Bart Lateur)
Re: What is wrong with this script? (Martin Vorlaender)
What you need is a Publicity Agent! <Agent.TrashCan@USA.NET>
Re: Which language pays most 17457 -- C++ vs. Java? <carla@ici.net>
Re: Which language pays most 17457 -- C++ vs. Java? (Kaz Kylheku)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 20 Dec 1997 08:45:08 -0800
From: Craig <design@kiwi.net>
Subject: 100.90 NOT 100.90000000000000568 HELP
Message-Id: <349BF614.EE806360@kiwi.net>
Sometimes when I make a calculation with Perl, it will do funny things
with the numbers. It will make a long decimal.
I tried the int() function, but that's no good, because I need the two
decimals (money value)
I tried multiplying by 100, then int(), and then dividing by 100. But
that doesn't solve it.
Does anyone know a function, or something, that will return my decimal
number "100.90000000000000568" back to "100.90" without using the printf
command ?
Thanks.
------------------------------
Date: 20 Dec 1997 17:01:10 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: 100.90 NOT 100.90000000000000568 HELP
Message-Id: <slrn69nujb.fs.mike@stok.co.uk>
On Sat, 20 Dec 1997 08:45:08 -0800, Craig <design@kiwi.net> wrote:
>Sometimes when I make a calculation with Perl, it will do funny things
>with the numbers. It will make a long decimal.
>
>I tried the int() function, but that's no good, because I need the two
>decimals (money value)
>
>I tried multiplying by 100, then int(), and then dividing by 100. But
>that doesn't solve it.
>
>Does anyone know a function, or something, that will return my decimal
>number "100.90000000000000568" back to "100.90" without using the printf
>command ?
You could use sprintf... You can check out the FAQ (see
http://www.perl.com and follow the links, or try this command:
perldoc perfaq
if you have a recent perl.) If you subscribe to The Perl Journal then Tom
Phoenix has written a good article on Unreal Numbers which is in the
Winter 1997 copy - check out http://tpj.com
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@colltech.com | Collective Technologies (work)
------------------------------
Date: 20 Dec 1997 18:13:13 +0100
From: Erik Bertelsen <erik@mmm.uni-c.dk>
Subject: Re: 100.90 NOT 100.90000000000000568 HELP
Message-Id: <siu3c4aqfq.fsf@mmm.uni-c.dk>
Craig <design@kiwi.net> writes:
> I tried the int() function, but that's no good, because I need the two
> decimals (money value)
Because of the way floating point numbers (reals) work on computers,
you'll never get exact results when using a value like 1.09 -- you'll
get it with a precision of a certain amount of bits, which will show
as a small variation after a certain amount of digits.
If you want to perform exact monetary calucations, you should always
use integer numbers (or BCD numbers), e.g. by working with integer
valued cents, pennies, pfennig, or whatever. Then you'll have a chance
of avoiding rounding errors.
- Erik
------------------------------
Date: Fri, 19 Dec 1997 21:02:34 -0600
From: Pete Thurmes <pete@isis.spa.umn.edu>
Subject: csh ==> perl?
Message-Id: <349B354A.7E17@isis.spa.umn.edu>
Not EVER having used perl even a little, and having multitudes
of csh scripts I use regularly, I am curious about whether there is
a csh-to-perl translator around, even a rough one. If so, I will
probably jump in the pool, even it it means tidying up the translations.
But if not, I find myself stuck with the FORTRAN syndrome: I have
too much invested in an archaic language to be able to afford
to migrate to a new one. It probably wouldn't be worth my
while learning a whole new scripting language considering that
I do very little scripting these days.
Along that line, is there such a thing as standalone csh for PC's? (That
is,for DOS/Lose95, not PC UNIX)
THanks in advance to any who may help me out here. Please email me, but
post if you think others are interested.
--
Pete Thurmes pete@isis.spa.umn.edu
------------------------------
Date: Sat, 20 Dec 1997 11:33:43 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Downloading ALL CPAN Modules?
Message-Id: <adelton.882617623@aisa.fi.muni.cz>
rsr@best.com (Roy S. Rapoport) writes:
> This whole thing started when I downloaded LWP, and it complained
> about the absence of MIME::Base64, and then I downloaded Net::FTP and
> it complained about the absence of DATA::Dump, etc etc.
I believe that that's what are bundles for. Try b in your
perl -MCPAN -e shell.
> So I figure: Hey, I've got a decent net connection and the diskspace
> to afford it, why don't I just download ALL the modules?
Download yes, but probably not install.
> It looks like all the modules are in the CPAN directory under
> authors/id/<AuthorID>. This makes it somewhat hard to get all of them
> (especially when I seem to be having a problem with a site that will
> keep a connection open long enough for me to be able to do an mget -R
> within ncftp)
You might want to set up private mirror of CPAN and the nfs mount it
on your machines, or make the CPAN available through ftp -- no problem
for CPAN with LWP.
>
> So two questions:
> A) Why _shouldn't_ I download+install all the modules?
They might be incompatible. Also, many of the modules are merely glues
to other software that you need to have before installing -- DBD being
major example. And some (DBD::Oracle) expect to have certain
environment variables set before install -- they do not ask for the
ORACLE_HOME. Or for example PGP::Sign has a feature (bug ;-) that it
assumes that pgp is installed where it is not. It doesn't ask so you
probably want to check every upgrade.
Another example: jpl tries to be clever and uses perl$] to run perl in
later stages of the install -- pretty bad when I want to have three
copies of 5.00404 on my disk -- it chooses one and you have to change
the install scripts.
> B) Has anyone come up with an automated way to get all the modules? It
> doesn't _look_ like the CPAN module deals with 'install *' ...
I do not think there is such a way. But bundles are nice thing and r
in -MCPAN -e shell as well. I run it twice a week to see if I need to
upgrade something and somethimes users ask for new module -- no
problem. When upgrading Perl, I use snapshot to save the state and
then install it back.
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
I can take or leave it if I please
------------------------------------------------------------------------
------------------------------
Date: Sat, 20 Dec 1997 14:24:06 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: embare-assed newbie Q
Message-Id: <349cd118.592256@news.tornado.be>
ushere@ibm.net wrote:
>I'm having trouble getting a file written with tab
>field separators. All the saves use a single space
>instead.
>
>is/are there any obvious goofs in this?
Yes.
$,="\t"; $\="\n";
foreach $ix (keys %hash)
{
print PENCIL @{$hash{$ix}};
}
If you insist on using YOUR syntax (i.e. using the quotes), look at the
special variable $". That was the "obvious goof".
HTH,
Bart.
------------------------------
Date: Sat, 20 Dec 1997 10:32:13 -0500
From: ushere@ibm.net
To: Bart Lateur <bart.mediamind@tornado.be>
Subject: Re: embare-assed newbie Q
Message-Id: <349BE4FD.6204@ibm.net>
Bart Lateur wrote:
>
> ushere@ibm.net wrote:
>
> >I'm having trouble getting a file written with tab
> >field separators. All the saves use a single space
> >instead.
> >
> >is/are there any obvious goofs in this?
>
> Yes.
>
> $,="\t"; $\="\n";
> foreach $ix (keys %hash)
> {
> print PENCIL @{$hash{$ix}};
> }
>
> If you insist on using YOUR syntax (i.e. using the quotes), look at the
> special variable $". That was the "obvious goof".
>
> HTH,
> Bart.
Oh great, 5 minutes after reading this
the $" got it all working right.
' I ' can't afford to insist on anything,
being so poor that I can't even change my mind.
But I do like Perl more and more, coming from
AmigaBasic and dos/Qbasic.
Thanks very much!
-|- Who, has loved us more? -|-
------------------------------
Date: Sat, 20 Dec 1997 16:17:22 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: embare-assed newbie Q
Message-Id: <ebohlmanELHx8z.G8y@netcom.com>
ushere@ibm.net wrote:
You've already heard about what your separator problem is, but there's
another bug that just hasn't hit you yet.
: open PENCIL, "> $fid" || die "can't open $fid ... $! \n";
If you really aren't able to open the file, this won't die. Either put
parens around 'PENCIL, "> $fid"' or change the '||' to 'or'. As it
stands, the statement is parsed as:
open PENCIL, ("> $fid || die...)
i.e.: if "> $fid" is non-null (which it always will be), open it as PENCIL.
If it is null, open "die..." as PENCIL. If the open fails, who cares.
This is not what you want.
------------------------------
Date: Sat, 20 Dec 1997 11:43:34 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: getting directory size
Message-Id: <adelton.882618214@aisa.fi.muni.cz>
Brian <signal@shreve.net> writes:
> sizes. Also feel free to critisize my code and tell me any other places
> I am doing something wrong and could make it better/faster.
You should use File::Find. There might be a problem with chdir '..' --
if you came through symlink, you might get back somewhere else.
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
I can take or leave it if I please
------------------------------------------------------------------------
------------------------------
Date: Sat, 20 Dec 1997 09:12:44 -0500
From: MrPc <tjbiuso@redrose.net>
To: Jason Schutz <jds35239@pegasus.cc.ucf.edu>
Subject: Re: Help on accessing the cgi-bin directory
Message-Id: <349BD25B.24A83FA5@redrose.net>
Jason Schutz wrote:
> I don't know what the problem is, maybe just a lack of privlidges,
>
> but I have the password for an account on an NT server and the cgi-bin
> I
> need to access runs parallel to my directory and I can't access it.
> Is
> there any way other than saying cd ../cgi-bin (which I tried) to
> access
> this directory. Plus I've tried using put and get put that doesn't
> work
> either. Please help.
correct me if i'm wrong, but don't most nt servers have a "Scripts"
directory rather than a cgi-bin?....
------------------------------
Date: Sat, 20 Dec 1997 14:32:12 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Help with pattern matching please?
Message-Id: <34a1d6bb.2032115@news.tornado.be>
aml@world.std.com (Andrew M. Langmead) wrote:
>One way of solving it would be to use the \Q and maybe the \E escape
>sequences to "quote" metacharacters. But since you want to match the
>extension, maybe you want to include the metacharacter to match the
>end of the string.
>
> if ($form_data{ticket} =~ m/\Q$key$/i) {
AH you forgot the "\E". Now "$" has lost it's special meaning.
if ($form_data{ticket} =~ m/\Q$key\E$/i) {
>Another would be to make the key a regular expression that matches.
>
> '\.Chr$' => 'Christmas',
A "neat" solution (it is in the PODs, I'm sure), is to replace all
non-word characters (i.e. no letters, digits and underscore) by it
preceded wit ha backslash:
$_ = ".Chr";
s/(\W)/\\\1/g;
print ;
=>
\.Chr
HTH,
Bart.
------------------------------
Date: Sat, 20 Dec 1997 11:47:35 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: hey guyz! plz help me out!
Message-Id: <349badf6.11665191@news.tornado.be>
comdog@computerdog.com (brian d foy) wrote:
>Michael Budash wrote:
>
>>you might try selena sol's form processor script
>>(http://www.fukada.com/selena/Scripts/scripts.html) - i think it'll do all
>>you ask (and more).
>
>that's a very old and somewhat monstrous way to accomplish such a
>simple task.
You could say something similar of CGI.pm (not old, but monstrous
anyway. 160k of source!).
Bart.
------------------------------
Date: Sat, 20 Dec 1997 01:14:45 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How do i process a variable length array
Message-Id: <59rf76.9o9.ln@localhost>
lee.gammell@feedME wrote:
: Can you help an absolute beginner...?
[snip]
: This is what i've got so far...
: open(PS, '/bin/ps -ef|') || die "Can't open process table.\n";
This does not help with your question, but the above is very
likely not doing what you think it's doing (in regards to
error detection).
You might want to have a look at the Perl FAQ, part 8:
"Why doesn't open() return an error when a pipe open fails?"
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 18 Dec 1997 02:30:02 GMT
From: "Ho Seng Yip" <cybercom@pacific.net.sg>
Subject: HTML File
Message-Id: <01bd0b5c$77782060$LocalHost@oasis>
Hi,
I will like to save the input of a form data into a html file for display
or collection of all the inputs. What I did was to write the data into a
text file like the one below,
Stephen|stephen.ho@hotmail.com|Welcome
Stephen|stephen.ho@hotmail.com|Welcome again
After which the file will be read and a html version of the file will be
produced. The problem I had was that if there were empty lines in the
input, for example,
Welcome once again
Regards,
Stephen
The whole text file will be messed up and the output unsightly. Once that
occurs, the text file will be something like,
Stephen|stephen.ho@hotmail.com|Welcome
Stephen|stephen.ho@hotmail.com|Welcome again
Stephen|stephen.ho@hotmail.com|Welcome once again
Regards,
Stephen
As you can see there were to extra potruding lines comming out in the text
file. Can someone kindly advise me of the best solution in this case ?
Hope to hear some replies soon ! ;-)
Regards,
Seng Yip
------------------------------
Date: Sat, 20 Dec 1997 17:46:47 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Perl 5 syntax
Message-Id: <67h090$b3i$1@cyprus.atlantic.net>
According to kchadha@hotmail.com:
>(Assume A, B and C each have a function PRINT which
>takes a parameter x).
>(Also, assume I get read a variable $function which
>can either contain the value A, B or C). I want
>to do the following:
>
>$function::PRINT($x)
>
If inheritance is either not involved or actually desired, you can say:
$function->PRINT($x)
Otherwise, you can say:
&{$function.'::PRINT'}($x)
Enjoy.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
** Perl Training from Stonehenge Consulting Services: (503) 777-0095 **
"All you need is a toxic landfill /
A cycle and a sidecar and an urge to kill" // MST3K
------------------------------
Date: 20 Dec 1997 11:42:40 -0500
From: jstone@america.net (Jeff R. Stone)
Subject: Re: Perl editor needed
Message-Id: <x6yb1gvudb.fsf@stone.america.net>
>>>>> "Neil" == Neil Burnett <spectd@horus.sara.nl> writes:
Neil> On 6 Dec 1997 08:00:22 GMT, syng@jalisco.engr.ucdavis.edu
Neil> (Michael Ng) wrotz:
>> <Previously, Larry Hanlon said he is looking for a Perl editor>
>>
>> I personally love using Emacs, both in Unix/NT/Win95. I use
>> Emacs in almost all of my Programming tasks (except in Visual
>> C++ and some short programs -- #line < 10). I am a helpless
>> color-lover. The program displayed in NTEmacs is very
>> colorful. comment is green. string is brown etc.
>>
>> Emacs is huge, if you wnat to get the whole package.
>>
>> Justt my opinion.
>>
>> -- Michael (syng@engr.ucdavis.edu)
>> +--------------------------------------------------------------+
>> | http://www.engr.ucdavis.edu/~syng/ | | <PGP public key:
>> http://www.engr.ucdavis.edu/~syng/mike.pgp> |
>> +--------------------------------------------------------------+
Neil> I just use MS-WORD. The only addition is a word basic script
Neil> to run the perl script and save it as .doc and .pl files at
Neil> the same time. This means I can use all the editing and
Neil> formatting of WORD for an informative display and then just
Neil> save and run a text only version when I click on my 'Run
Neil> Perl script' button. Here it is converted to Word 97:
Neil> Public Sub MAIN() Dim script$ script$ =
Neil> WordBasic.[FileName$]() script$ =
Neil> WordBasic.[FileNameInfo$](script$, 4) WordBasic.ChDir
Neil> "f:\HTTPd\CGI-BIN" WordBasic.FileSaveAs Format:=2,
Neil> Name:=script$ + ".pl" WordBasic.ChDir "f:\CGI-DOC"
Neil> WordBasic.FileSaveAs Format:=0, Name:=script$ + ".doc"
Neil> WordBasic.ChDir "f:\HTTPd\CGI-BIN" WordBasic.Shell
Neil> Environ("COMSPEC") + " /c perl " + "f:\HTTPd\CGI-BIN\" +
Neil> script$ + ".pl >" + "f:\CGI-HTM\" + script$ + ".txt"
Neil> WordBasic.MsgBox "The results of this script have been saved
Neil> as " + "f:\CGI-HTM\" + script$ + ".txt" WordBasic.FileOpen
Neil> Name:="f:\CGI-HTM\" + script$ + ".txt",
Neil> ConfirmConversions:=0, ReadOnly:=0, AddToMru:=0,
Neil> PasswordDoc:="", PasswordDot:="", Revert:=0,
Neil> WritePasswordDoc:="", WritePasswordDot:="" End Sub
Neil> Of course, it uses my path names to cgi-bin, cgi-doc and
Neil> cgi-htm (for results).
I don't think that people can really appreciate the benefits of an
editor with features designed for programming until they have used one
regularly for a while (my personal choice is Emacs although there are
others -- particularly it seems on the Windows platform).
Benefits like color syntax-highlighting, automated indentation (with
selectable style), brace/bracket/paren matching, tags support, class
browser, single command commenting and uncommmenting of entire regions
of code, integrated compilation and debugging, and other
programming-specific features are benefits that I could not live
without and program with MS-Word.
There are free as well as commercial editors for programmers. I would
encourage you to try one (or a few) if coding (whether in Perl, C,
Java, or whatever) is something you do on a regular basis. You might
be very pleasantly surprised.
Jeff
- --
Jeff R. Stone <jstone@america.net>
PGP Key: http://www.america.net/~jstone/
Fingerprint: A6 70 4D 2E A1 F9 CF 08 58 96 A9 45 0A 06 99 59
Version: 2.6.2
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface
iQCVAwUBNJv1dlyDISb92kqpAQGa8AQAh8OaGGHuyQuhtOZzJ9dF9mF5Pi6OfT8F
3p1wvpQr7X0zTe5MXlseVCYQx2mrniEQfmD0F9YGbUVzVHb4aFj4X9l/0SMl/Gby
0XEI1evG5hnSaXskWBskbRl7PeyLKglUplZmwiO3nWs6lEKg7qFubdm5dFLy5LLH
EoB85x6hmGk=
=A9Za
-----END PGP SIGNATURE-----
------------------------------
Date: Sat, 20 Dec 1997 01:29:31 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: printing quotes with print command
Message-Id: <r4sf76.av9.ln@localhost>
brian d foy (comdog@computerdog.com) wrote:
: In article <67borr$dvj$2@legends.cet.com>, bell@cet.com (Glen Bell) wrote:
[snip]
: print NEWFILE
: qq{<body bgcolor="#FFFFFF" background="../backgrounds/ruff.jpg">};
: which can be perverted to one of my favorite constructions as of late:
: print NEWFILE
: q q<body bgcolor="#FFFFFF" background="../backgrounds/ruff.jpg">q;
^
^
Note that those two constructions are not equivalent, they just
work the same because it is a constant string.
You get no variable interpolation with the second one, for that you'd want:
qq q<body bgcolor="#FFFFFF" background="../backgrounds/ruff.jpg">q;
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 20 Dec 1997 14:52:06 GMT
From: tpuck@usa.net (Puck)
Subject: Read in Mailfolder
Message-Id: <349bdb48.1562155@news.odn.de>
Hi !
Can someone give me a script that shows how to read in
/var/spool/mail/root or /var/spool/mail/user_name ?
Please don't make it to complicate because I'm new at perl !
Thanx !
Bye, Thomas
------------------------------
Date: Sat, 20 Dec 1997 11:49:24 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Regular Expression Question - non greedy match
Message-Id: <adelton.882618564@aisa.fi.muni.cz>
phenix@interpath.com (John Moreno) writes:
> I was trying to correct a soup file that had been edited so that the
> article length was correct and ran into some behavior that I don't
> understand (why not what).
>
> I'm slurping the whole file in and then using the expression:
>
> $count = s/(#! rnews )(\d+\n)(.+?)/$1.(length $3).("\n").$3/gse;
>
> Which gives 1 char for the (length $3), I would have thought that it
> would go until it hit the next #! rnews.
>
> Why doesn't it?
Why should it? You said .+? which means at least one any character and
the least possible count. Which gives us nice 1.
You probably wanted something like
(#! rnews )(\d+\n)(.+?(?=#!|$))
to make it extend till next #! or end.
Hope this helps,
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
I can take or leave it if I please
------------------------------------------------------------------------
------------------------------
Date: Sun, 21 Dec 1997 00:05:58 GMT
From: scott@doc.net.au (Scott Howard)
Subject: Re: Restricting CGI Programs to Perl.
Message-Id: <349f43fb.22962821@news.syd.a2.com.au>
On Sat, 13 Dec 1997 22:41:13 -0600, jake@blacksun.net (Jake Burns)
wrote:
>> 1. Is their an easy way to have a web server restrict CGI programs to
>> Perl in an UNIX environment (Solaris 2.6 running SWS 1.0)? 2. Is
>> there a way to restrict Perl to what it can spawn, such as only
>> sendmail, etc? Any information on how to accomplish this is
>> greatly appreciated.
>
>Add a group and put all users in that group. Make sure whoever your web
>server runs as is *not* in the group.
>
>Lets assume you name this group 'users':
>
># for a in `find / -print`; do chmod o-x $a; done
># chmod a+x `which perl` `which sendmail`
># chgrp -R users /bin /usr/bin /usr/local/bin /opt
The problem with this is that it will break anything which is SGID and
relies of it's group privledges (and possibly some other things...)
The safest way it to setup your web environment within it's own
directory tree, with it's own copies of Perl and whatever else is
allowed to be run, and run everything chroot into that environment.
(Sendmail needs some tweaking if your mailhost is that same machine,
but it can be done).
Scott.
------------------------------
Date: Sat, 20 Dec 1997 11:47:31 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <349caecf.11881705@news.tornado.be>
Greg Bacon <gbacon@cs.uah.edu> wrote:
Top 10 Posters by OCR (minimum of five posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.879 ( 9.9 / 11.2) 7 aml@world.std.com (Andrew M. Langmead)
0.847 ( 7.0 / 8.3) 9 Stephan Vladimir Bugaj <bugaj@bell-labs.com>
0.755 ( 4.5 / 6.0) 6 Randal Schwartz <merlyn@stonehenge.com>
0.687 ( 5.9 / 8.6) 7 Anthony David <adavid@netinfo.com.au>
0.666 ( 6.1 / 9.2) 7 tadmc@metronet.com (Tad McClellan)
0.641 ( 2.1 / 3.3) 6 bart.mediamind@tornado.be (Bart Lateur)
0.638 ( 1.3 / 2.0) 5 tchrist@mox.perl.com (Tom Christiansen)
0.626 ( 3.0 / 4.8) 6 adelton@fi.muni.cz (Honza Pazdziora)
0.566 ( 9.9 / 17.4) 33 Tom Phoenix <rootbeer@teleport.com>
0.550 ( 2.9 / 5.2) 5 rjk@coos.dartmouth.edu
Bottom 10 Posters by OCR (minimum of five posts)
=================================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.687 ( 5.9 / 8.6) 7 Anthony David <adavid@netinfo.com.au>
0.666 ( 6.1 / 9.2) 7 tadmc@metronet.com (Tad McClellan)
0.641 ( 2.1 / 3.3) 6 bart.mediamind@tornado.be (Bart Lateur)
0.638 ( 1.3 / 2.0) 5 tchrist@mox.perl.com (Tom Christiansen)
0.626 ( 3.0 / 4.8) 6 adelton@fi.muni.cz (Honza Pazdziora)
0.566 ( 9.9 / 17.4) 33 Tom Phoenix <rootbeer@teleport.com>
0.550 ( 2.9 / 5.2) 5 rjk@coos.dartmouth.edu
0.532 ( 5.7 / 10.8) 19 comdog@computerdog.com (brian d foy)
0.428 ( 2.3 / 5.3) 5 abigail@fnx.com
0.365 ( 0.9 / 2.6) 5 scribble@tekka.wwa.com (Tushar Samant)
WOW! I'm both in the top 10 and in the bottom 10!
And it's not just me: it looks like the statistics only included 13
posters... Anthony David is both number 4 and number 10th from the
bottom up.
Ah... the decline of CLPM... ;-)
Bart.
------------------------------
Date: Sat, 20 Dec 1997 13:18:52 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: What is wrong with this script?
Message-Id: <349bb7ac.524144494f47414741@radiogaga.harz.de>
guardian@ok.azalea.net wrote:
: Can anyone tell what is wrong with this script? I got it from
: apacheweek... It gives me this error at runtime: Can't use an undefined
: value as filehandle reference at ./htpasswd2dbm.pl line 23.
[...script snipped, apart from line 23 (if I count right)...]
: $fh = STDIN;
Read The Fine Manual...
On page 51 in the Camel book ("Typeglobs and Filehandles"):
"If you want to save away a filehandle, do it this way:
$fh = *STDOUT;
or perhaps as a real reference, like this:
$fh = \*STDOUT;"
The same example is given in the perldata POD page.
cu,
Martin
--
| Martin Vorlaender | VMS & WNT programmer
Ceterum censeo | work: mv@pdv-systeme.de
Redmondem delendam esse. | http://www.pdv-systeme.de/users/martinv/
| home: martin@radiogaga.harz.de
------------------------------
Date: Sat, 20 Dec 97 05:20 EST
From: <Agent.TrashCan@USA.NET>
Subject: What you need is a Publicity Agent!
Message-Id: <m0xjM1I-0006BYC@maccs.dcss.mcmaster.ca>
Wishing you a joyous holiday season, and a most prosperous New Year.
---------------------------------------------------------------------
Posted by MarketCom's MktAgent, interNet's premier publicity engine.
Got something to say, a cause to promote, or goods/services to sell?
Then get the message out to thousands of open-minded, well-educated
individuals all over the world.
Locate & Contact 100,000 interested leads, potential clients, and/or
penpals, in only five days by utilizing our FREE MktAgent demo model.
---------------------------------------------------------------------
Good Luck! God Bless! Do Business! http://MarketCom.com/MktAgent/
A mirror site is located at http://www.aoci.com/fontsasoc/marketcom4/
---------------------------------------------------------------------
bflmmqhcicc q zqhq i pwkcftg j p ucwet hbjhxbllwlt vdcyezkdec edwsv
------------------------------
Date: Fri, 19 Dec 1997 22:02:47 -0500
From: Alicia Carla Longstreet <carla@ici.net>
Subject: Re: Which language pays most 17457 -- C++ vs. Java?
Message-Id: <349B3557.60EA@ici.net>
Lawrence Kirby wrote:
> Tad McClellan writes:
> >Mark Framness (framness@EMIRATES.NET.AE) wrote:
> >: In message <34958D16.190C@gsg.eds.com> - "Shmuel (Seymour J.) Metz"
> >: <nospam@gsg.eds.com>Mon, 15 Dec 1997 12:03:34 -0800 writes:
> >: #>> C provides the needed primitives to do anything you need.
> >: #>You got this wrong; C does not have the needed primitives to handle
> >: #>sets, do string matching, do record-oriented I/O, etc., except in the
> >: #>trivial sense that anything can be simultated on anything else.
> >: What do you mean sets? As in the mathematical sense? String matching? Huh?
> >: what do strcmp, strstr etc do?
> > ^^^^^^ ^^^^^^
> >Those are not *primitives* (ie. built-in to the language).
> The standard library is built into th C language.
A library is *not* part of a langauge, rather it is constructed *from*
the language. In my not-so-humble opinion.
> >Those are library calls (ie. add-ons to the language).
> No, they are an inherent part of the language. A compiler can't call itself
> a hosted C implementation unless it provides the standard library.
In your not-so-humble opinion. Some do not share this opinion.
There is, of course, no need to go into this debate again. You are not
about to change you opinion and I am not about to change mine. I will
not buy a implementation where I was unable to replace any of the
standard library functions at will. I would consider such an
implementation a pitiful excuse for a compiler.
--
****************************************************************
What is the speed of dark?
When you're sending someone Styrofoam, what do you pack it in?
Why are there Braille signs on drive-up ATM's?
How come you never hear about gruntled employees?
I have an answering machine in my car.
It says "I'm home now.
But leave a message and I'll call when I'm out."
=========================================
Alicia Carla Longstreet carla@ici.net
=========================================
READ THE FAQ for more information:
C-FAQ ftp sites: ftp://ftp.eskimo.com or ftp://rtfm.mit.edu
Hypertext C-FAQ: http://www.eskimo.com/~scs/C-faq/top.html
------------------------------
Date: 20 Dec 1997 17:37:46 GMT
From: bill@cafe.net (Kaz Kylheku)
Subject: Re: Which language pays most 17457 -- C++ vs. Java?
Message-Id: <67gvpa$m3t$1@brie.direct.ca>
In article <349B0417.D4DB6A30@its.cl>,
Guillermo Schwarz <gschwarz@its.cl> wrote:
>This is a multi-part message in MIME format.
>--------------EC36FA96B4325E47CB41380A
>Content-Type: text/plain; charset=us-ascii
>Content-Transfer-Encoding: 7bit
>
>
>
>Kaz Kylheku wrote:
>
>> In article <e9k976.8h3.ln@localhost>, Tad McClellan <tadmc@metronet.com> wrote:
>> >: what do strcmp, strstr etc do?
>> > ^^^^^^ ^^^^^^
>> >
>> >Those are not *primitives* (ie. built-in to the language).
>> >
>> >Those are library calls (ie. add-ons to the language).
>>
>> Nonsense. They are standard parts of the C language required by the ISO
>> standard.
>
>The standard C library, but not he standard C language.In the same way, other
>languages have standard libraries.
>Some have huge libraries, as Smalltalk does.
The library is part of the language, you buffoon, the same way that basic
words like 'air' and 'water' are part of English.
In C, the standard library functions have special status. First of all, their
names are reserved external symbols. If any C program contains an external
definition of an identifier that is an external name reserved by the standard
library, the behavior is undefined.
Secondly, if you include a standard header, you may not redeclare any symbol
in that standard header, not even in a nested scope.
>> >You won't find 'strcmp' in a C compiler's grammar.
>>
>> I use a compiler which will inline functions like strcpy() and abs().
>
>It has nothing to do with optimization. The point is that C has no built-in support
>for Strings.
I'm not talking about optimization. I'm talking about recognition of standard
functions as thought they where primitives. The C standard permits an
implementation to do that.
>Even worse, that optimization can be a bug.
>What if I define a class:
Doh! You can't define a class in C.
>class foo()
>{
>public:
> char * strcmp( char * a, char * b ) { ... }
> void bar()
> {
> ...
> strcmp( a, b );
> ...
> }
>};
>
>I wouldn't expect the compiler to "optimize" my code.
The above is C++, not C. It defines strcmp as a member function of class foo.
It cannot possibly be mistaken for the strcmp in <string.h>. It's full
name is foo::strcmp. It also has a different type signature.
Do you have any clue how compilers work? The name strcmp will be looked up
in a symbol table for the current scope. The compiler will recognize
that it belongs to the class scope foo:: so that it cannot possibly be
the standard function.
In C, it's like this: a strictly conforming program may not define its own
strcmp() function with external linkage. If you want to write your own strcmp,
you would have to give it internal linkage using the static keyword: static
int strcmp(...) { ... }. You are then forbidden from including the <string.h>
header in that translation unit. The compiler is then required to recognize
that you have defined your own strcmp and no longer treat it as a built-in
primitive.
It works just fine in GCC, for instance.
[ nyc.foods, misc.jobs.* trimmed from header ]
------------------------------
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 1513
**************************************