[17287] in Perl-Users-Digest
Perl-Users Digest, Issue: 4709 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 24 11:05:32 2000
Date: Tue, 24 Oct 2000 08:05:14 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <972399914-v9-i4709@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 24 Oct 2000 Volume: 9 Number: 4709
Today's topics:
Re: ActivePerl: Want to skip open files when unlinking (Martien Verbruggen)
Associative Array Increment ljl_ljl@my-deja.com
Re: Associative Array Increment <jkline@one.net>
Re: Associative Array Increment xerxes_2k@my-deja.com
Re: Associative Array Increment ljl_ljl@my-deja.com
Re: Associative Array Increment xerxes_2k@my-deja.com
Re: Associative Array Increment (Gwyn Judd)
Bi-directional pipes with NT <hmacdonald@europarl.eu.int>
Re: CGI to run makefile <tony_curtis32@yahoo.com>
Re: Don't use -w in CGI? <pdcawley@bofh.org.uk>
Re: errors <mjcarman@home.com>
Re: errors xerxes_2k@my-deja.com
Re: errors xerxes_2k@my-deja.com
Re: File Locking and CGI jeacocks@uk.ibm.com
Re: Help with array concatenation (Anno Siegel)
Re: how to convert 2 arrays to 1 hash <sariq@texas.net>
HTML::Form and checkboxes bug? <stefan@inty.net>
Re: Legal email addresses... <iltzu@sci.invalid>
Re: Legal email addresses... (Martien Verbruggen)
local binmode? pingu2@my-deja.com
Re: local binmode? <mjcarman@home.com>
Re: local binmode? (Gwyn Judd)
Make me a hot or not script <matthijs@vanduijvenbode.com>
Re: New to Perl, Need Help ! (Gwyn Judd)
Re: OT: Jihad definition (NP)
Re: OT: Jihad definition <jeff@vpservices.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 24 Oct 2000 21:58:39 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: ActivePerl: Want to skip open files when unlinking
Message-Id: <slrn8vaqqv.k23.mgjv@martien.heliotrope.home>
On Tue, 24 Oct 2000 08:57:15 GMT,
Gus <gus@black.hole-in-the.net> wrote:
> jgrinwal@my-deja.com wrote:
>
> > The problem is, the application still has log file open--it just hasn't
> > updated it because the application has been idle. The "unlink"
> > returns "Permission denied", the same error I would get if the file /
> > directory permissions did not allow deleting.
>
> Would it be better to say
>
> foreach file
> if [ exists ]
> stat perms
> if [ perms permit delete ]
> unlink || file must be open
>
> Explicity check if you can delete the file, and if you can't the only other
> possibility is that NT is preventing you becase the file is open.
Or you do not have the permissions to remove the file because of
something else than the permissions on the file itself (does NT have ACL
functionality, or something like that?), or the file doesn't exist
anymore (because something else removed it just when you weren't
looking), or it is a directory with files still in it, or the file
doesn't exist, because for some reason you constructed the path to it
incorrectly, or NT ran out of memory while it was trying to do this, or
there was a file system error or corruption. NT might even have other
reasons that I didn't think of. And the developers might invent other
reasons tomorrow, for the next release of the OS.
Never assume that you know why an unlink, or any system call, fails.
Inspect the $! variable to find out. If you can't unlink the file, you
can't. All you can do is display the reason. If the OS doesn't give you
more reason than 'permission denied', then that is sad, but it is all
you have. Assuming that there are only two possible reasons for that
error even is false. Assuming that there are only two possible errors in
total is plainly silly.
To the OP: Make the application that has the log file open behave more
sanely, and have it rotate its log files after an appropriate time. That
means that you can delete or move the old copies, while it still has its
current copy open. This is standard behaviour for long running processes
and daemons, and any decent application worth its salt should be able to
rotate its log files itself, or be told to rotate them, without the need
to shut down. If this application can't do that, complain loudly ad
anoyingly to its author. (On Unix a reopen is enough, and externally you
can just rename the file. I don't know whether that will work on NT).
Martien
--
Martien Verbruggen |
Interactive Media Division |
Commercial Dynamics Pty. Ltd. | What's another word for Thesaurus?
NSW, Australia |
------------------------------
Date: Tue, 24 Oct 2000 13:38:14 GMT
From: ljl_ljl@my-deja.com
Subject: Associative Array Increment
Message-Id: <8t43c7$2jd$1@nnrp1.deja.com>
Below is the coding of a perl script from a perl-teaching book.
I can't really understand what line 10 and 11 about the increment does.
Can anyone explain that to me?
You can see the output at
http://commonwealthnpcc.virtualave.net/numbers/ifthen.pl
#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
for ($NumberOfUsers = 0; (@pwdlist = getpwent); $NumberOfUsers++) {
$user = $pwdlist[0];
$userlist[$NumberOfUsers] = $user;
$shelltype = $pwdlist[8];
$groupids = $pwdlist[3];
$shell_list{$shelltype}++;
$usershell{$user} = $shelltype;
}
for ($count = 0; $count < $NumberOfUsers; $count++) {
print "user number $count is $userlist[$count] \n<br>";
}
print "\n========================================\n<br>";
foreach $group (keys(%group_list)) {
print "There are $group_list{$group} members of the $group
group\n<br>";
}
print "\n========================================\n<br>";
foreach $shell (keys(%shell_list)) {
print "There are $shell_list{$shell} users using the $shell
shell\n<br>";
}
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 24 Oct 2000 10:21:56 -0400
From: Joe Kline <jkline@one.net>
Subject: Re: Associative Array Increment
Message-Id: <39F59B03.5213E109@one.net>
ljl_ljl@my-deja.com wrote:
>
> Below is the coding of a perl script from a perl-teaching book.
> I can't really understand what line 10 and 11 about the increment does.
> Can anyone explain that to me?
<SNIP>
> $shell_list{$shelltype}++;
This is a shortcut that uses $shelltype as the key in the hash and
then uses '++' to increment the value associated with that key. So,
it's basically the perl idiom of loading up a hash.
Alternately it could be written:
$shell_list{$shelltype} += 1;
--
Joe Kline
It takes a lot of brains to enjoy satire, humor, and wit;
but none to be offended by them. ---The Midnight Skulker
------------------------------
Date: Tue, 24 Oct 2000 14:19:36 GMT
From: xerxes_2k@my-deja.com
Subject: Re: Associative Array Increment
Message-Id: <8t45pf$4nt$1@nnrp1.deja.com>
from the looks of it line 10 is incrementing (adding 1) to the value
stored in the $shell_list{$shelltype} element of the hash (associative
array).
line 11 is storing $shelltype in $usershell{$user} element.
do u actually know what hashes are?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 24 Oct 2000 14:27:09 GMT
From: ljl_ljl@my-deja.com
Subject: Re: Associative Array Increment
Message-Id: <8t467j$56e$1@nnrp1.deja.com>
I know what hashes are for. I also know that ++ means increment by 1.
But I don't understand why adding 1 is necessary.....
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 24 Oct 2000 14:34:37 GMT
From: xerxes_2k@my-deja.com
Subject: Re: Associative Array Increment
Message-Id: <8t46ls$5dt$1@nnrp1.deja.com>
in that case i appologise for my sarcasm. what is the purpose of the
script.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 24 Oct 2000 14:44:49 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Associative Array Increment
Message-Id: <slrn8vb82o.duj.tjla@thislove.dyndns.org>
I was shocked! How could ljl_ljl@my-deja.com <ljl_ljl@my-deja.com>
say such a terrible thing:
>Below is the coding of a perl script from a perl-teaching book.
>I can't really understand what line 10 and 11 about the increment does.
>Can anyone explain that to me?
Sure!
>#!/usr/local/bin/perl
ick. This is a bad example to be learning from. This line should be two:
#!/usr/bin/perl -w
use strict;
>print "Content-type: text/html\n\n";
Double ick. This person should be using the CGI module:
use CGI qw/:standard/;
>for ($NumberOfUsers = 0; (@pwdlist = getpwent); $NumberOfUsers++) {
Triple ick. This person should not be using a C style for loop. Also
keeping a count of the number of users is wasteful since you can infer
it from the other variables.
while (@pwdlist = getpwent)
{
> $user = $pwdlist[0];
> $userlist[$NumberOfUsers] = $user;
Quadruple ick. Of course since we don't need to keep a count of
$NumberOfUsers we just do this:
push @userlist, $pwdlist[0];
> $shell_list{$shelltype}++;
Ah the first bit of code with a modicum of perlishness about it. Not
enough to rescue this trash heap still. This is more-or-less equivalent
to the psudocode:
if we have seen some users with this type of shell before then
increment the count for people using that shell by one
else
set the count for people using that shell to one
> $usershell{$user} = $shelltype;
Pointless to be keeping this in a seperate variable from @userlist. I
would do:
$userlist{$user}{shelltype} = $shelltype;
This is a Hash of Hashes keyed on the username. This way we can keep all
of the information together in one place. You see we still don't need to
keep count of how many users there are since we can do:
$number_of_users = keys %userlist;
Now we don't even need to @userlist array at all since this hash does
the same thing as @userlist and @usershell at the same time. Also this
one line is equivalent to two of his.
> }
>for ($count = 0; $count < $NumberOfUsers; $count++) {
>
> print "user number $count is $userlist[$count] \n<br>";
> }
n-tuple ick. Why not just do:
$count = 0;
print "user number @{[$count++]} is $_\n<br>" foreach (keys %userlist);
Or less obscurely:
$count = 0;
printf "user number %d is $_\n<br>", $count++ foreach (keys %userlist);
>print "\n========================================\n<br>";
>
>foreach $group (keys(%group_list)) {
> print "There are $group_list{$group} members of the $group
>group\n<br>";
> }
Now why does he all of a sudden use a Perl style loop? Because you can't
index into a hash like you can an array of course. Same difference
really. I won't even go into the fact that the example didn't even set
the %group_list hash in the first place.
print "There are $group_list{$_} members of the $_ group\n<br>"
foreach (keys %group_list);
In short, if you are trying to learn from this, don't. There are much
better examples around.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
If money can't buy happiness, I guess you'll just have to rent it.
------------------------------
Date: Tue, 24 Oct 2000 16:23:10 +0200
From: macdo <hmacdonald@europarl.eu.int>
Subject: Bi-directional pipes with NT
Message-Id: <39F59B4E.61F25093@europarl.eu.int>
In NT is it possible to impliment bi-directional communication via pipes
between a parent and a child.
I have seen the examples for either writing to a child or to a parent in
http://www.perldoc.com/perl5.6/pod/perlfork.html
These work great.
But to merge them you get a loop (I think). At least my attempts to date
just hang.
Any help would be appreciated.
Also I need to have many children from the same parent - with
bidirectional communication for all of them.
Extracts from http://www.perldoc.com/perl5.6/pod/perlfork.html
###############################################
# The following example shows how to write to a forked child:
# simulate open(FOO, "|-")
sub pipe_to_fork ($) {
my $parent = shift;
pipe my $child, $parent or die;
my $pid = fork();
die "fork() failed: $!" unless defined $pid;
if ($pid) {
close $child;
}
else {
close $parent;
open(STDIN, "<&=" . fileno($child)) or die;
}
$pid;
}
if (pipe_to_fork('FOO')) {
# parent
print FOO "pipe_to_fork\n";
close FOO;
}
else {
# child
while (<STDIN>) { print; }
close STDIN;
exit(0);
}
###############################################
#And this one reads from the child:
# simulate open(FOO, "-|")
sub pipe_from_fork ($) {
my $parent = shift;
pipe $parent, my $child or die;
my $pid = fork();
die "fork() failed: $!" unless defined $pid;
if ($pid) {
close $child;
}
else {
close $parent;
open(STDOUT, ">&=" . fileno($child)) or die;
}
$pid;
}
if (pipe_from_fork('BAR')) {
# parent
while (<BAR>) { print; }
close BAR;
}
else {
# child
print "pipe_from_fork\n";
close STDOUT;
exit(0);
}
------------------------------
Date: 24 Oct 2000 08:38:06 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: CGI to run makefile
Message-Id: <87lmveqs01.fsf@limey.hpcc.uh.edu>
>> On Tue, 24 Oct 2000 15:36:11 +0800,
>> Fraser <r.fraser@student.murdoch.edu.au> said:
> I've made a HTML page which I write c code in and I want
> to submit it to a Perl CGI script to run a "makefile" on
> a UNIX system and send me back the executable. Can
> someone please advise on how this is possible. Regards
perldoc -f system
and you'll want to divert STDOUT and STDERR presumably.
> Fraser (I've set permissions and restriction so only I
> can access the pages.)
I'm glad you realise how nightmarishly dangerous this is!
hth
t
--
Eih bennek, eih blavek.
------------------------------
Date: 24 Oct 2000 12:08:07 +0100
From: Piers Cawley <pdcawley@bofh.org.uk>
Subject: Re: Don't use -w in CGI?
Message-Id: <m17l6ypkdk.fsf@rt158.private.realtime.co.uk>
"Godzilla!" <godzilla@stomp.stomp.tokyo> writes:
> JL Goldstein wrote:
>
> > I seem to remember reading somewhere that, once
> > one's Perl CGI script is debugged, the script
> > should not be on the Web server with the -w switch.
> > The reasoning, as I recall, was that error messages
> > printed to the browser window could give the user system
> > information that could facilitate hacking.
>
> > Thoughts? Suggestions?
>
>
> Who is 'one'? I read about this person as
> frequently as I read about 'them'.
And you a professor of English. Ah well, one obviously can't expect
much of English professors now.
> What better reason than to enhance security?
> Only piss poor programmers leave pragma hints
> and revealing information for a die statement,
> within a final script version for public use.
It would be a piss poor programmer indeed whose 'dies' propagated back
to the public unfiltered. But it's generally a good idea to make sure
you dump enough information into the error log to ensure that you can
work out what went wrong. After all, things can go wrong even in
production code, what with the real world being messy and
untrustworthy and all.
> There is another reason for removing warnings,
> strict and other pragma hints; they consume
> memory and slow your script, for naught.
Show us your benchmark results. I will be very surprised if the
putative performance gain is anything more than nominal...
--
Piers
------------------------------
Date: Tue, 24 Oct 2000 07:50:52 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: errors
Message-Id: <39F585AC.E06581FE@home.com>
xerxes_2k@my-deja.com wrote:
>
> i keep getting annoying errors in one of my scripts:
> [...]
>
> I dont understand what is so different about this script. Can anyone
> clarify?
How are we supposed to debug anything if we can't see your script? Can
you post a small excerpt which exhibits the problem, or at least post a
link to the source? Without that, all anyone can do is offer
speculation.
Throw us a bone, here! :)
If you just want to understand what the error messages mean, please
don't ask us to read the documentation to you. Type 'perldoc perldiag'
at a command line and look for your messages.
-mjc
------------------------------
Date: Tue, 24 Oct 2000 14:06:38 GMT
From: xerxes_2k@my-deja.com
Subject: Re: errors
Message-Id: <8t4518$447$1@nnrp1.deja.com>
i know what the error means.
i cant post exerpts as i dont know where the error is.
the script is 2 big 2 put the whole thing on here.
i am at work at the mo. and dont have access to my webspace, and would
get fired for using works webspace.
i will put on my website later.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 24 Oct 2000 14:13:42 GMT
From: xerxes_2k@my-deja.com
Subject: Re: errors
Message-Id: <8t45ef$4b9$1@nnrp1.deja.com>
do u believe in miracles.
i do now.
my script has suddenly decided to stop throwing up errors. and i dont
know why.
oh well.
thanx anyway.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 24 Oct 2000 11:56:01 GMT
From: jeacocks@uk.ibm.com
Subject: Re: File Locking and CGI
Message-Id: <8t3tch$r2e$1@sp4en10.hursley.ibm.com>
> Then use O_CREAT|O_WRONLY|O_EXCL with a sysopen()
As I understand it, this will open a file only if it doesn't already
exist. Are you suggesting that I use this to create my own locking
routine?
------------------------------
Date: 24 Oct 2000 10:08:37 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Help with array concatenation
Message-Id: <8t3n35$28u$1@lublin.zrz.tu-berlin.de>
Godzilla! <godzilla@stomp.stomp.tokyo> wrote in comp.lang.perl.misc:
>Incidently Verbruggen, books don't "get" out-of-date.
>Books "become" out-of-date. You won't learn this from
On whose authority? Dr. Kiralynne "Malice Intent" Schilitubi's?
Anno
------------------------------
Date: Tue, 24 Oct 2000 14:21:34 GMT
From: Tom Briles <sariq@texas.net>
Subject: Re: how to convert 2 arrays to 1 hash
Message-Id: <39F59AEE.BEB8A30F@texas.net>
"Thomas Åhlen" wrote:
>
> Thanks for all the answers guys!!
> This was exactly what i wanted :)
You might find Uri Guttman's introduction to hash slices useful:
http://www.sysarch.com/perl/tutorials/hash_slices.txt
- Tom
------------------------------
Date: 24 Oct 2000 10:24:33 GMT
From: Stefan Kruger <stefan@inty.net>
Subject: HTML::Form and checkboxes bug?
Message-Id: <8t3o11$jc4$1@starburst.uk.insnet.net>
Hi all,
I've come across something odd when using HTML::Form.
Either I don't understand what's going on, or there's
a buglet in the module. It doesn't seem to like checkboxes.
ted% cat formtest
#!/usr/local/bin/perl -w
use lib '/usr/local/lib/perl5/site_perl/5.6.0';
use strict;
use HTML::Form;
my @f = HTML::Form->parse(<<'EOT', "http://localhost/");
<form action="dummy">
<input type="checkbox" name="name" value="on">
</form>
EOT
my $f = shift @f;
$f->value(name => "off");
__END__
ted% ./formtest
Use of uninitialized value in string eq at
/usr/local/lib/perl5/site_perl/5.6.0/HTML/Form.pm line 621.
Illegal value 'off' at /usr/local/lib/perl5/site_perl/5.6.0/HTML/Form.pm
line 627.
It is probably my misunderstanding of how the module works. Can
anyone shed any light on this?
Cheers, stef
(Using perl 5.6.0 for i386 FreeBSD and libwww-perl-5.48)
--
Dr Stefan Kruger <stefan@inty.net>
Intelligent Network Technology
------------------------------
Date: 24 Oct 2000 11:11:52 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Legal email addresses...
Message-Id: <972384476.11624@itz.pp.sci.fi>
In article <lFcJ5.10144$bL1.207044@news6-win.server.ntlworld.com>, The Moriman wrote:
>Ilmari Karonen <iltzu@sci.invalid> wrote in message news:972377964.3571@itz.pp.sci.fi...
>>
>> looking at http://search.cpan.org/search?dist=MailTools
>
>my perl directory doesn't have a make.exe / make.com / make.bat
> file,nor does the directory where I am installing MailTools
>
>It's probably something simple, but what am I missing?
The standard Unix utility "make". Solutions from hardest to easiest:
1. Find a DOS port of GNU make somewhere on the web. Or try
http://language.perl.com/ppt/src/make/index.html
2. See if ActiveState has provided mailtools in PPM format. Most
likely they have, and you can install it with PPM.
3. Just copy the "Mail" directory and everything in it to the
directory you want to install the modules in.
I suppose installing Linux could also be considered one solution..
Any reasonable distribution should include both make and perl.
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla | "By promoting postconditions to
and its pseudonyms - | preconditions, algorithms become
do not feed the troll. | remarkably simple." -- Abigail
------------------------------
Date: Tue, 24 Oct 2000 22:00:25 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Legal email addresses...
Message-Id: <slrn8vaqu9.k23.mgjv@martien.heliotrope.home>
On Tue, 24 Oct 2000 10:30:47 +0100,
The Moriman <themoriman@ntlworld.com> wrote:
>
> Ilmari Karonen <iltzu@sci.invalid> wrote in message
> news:972377964.3571@itz.pp.sci.fi...
> But
> > why bother when others have already solved it for you? I'd recommend
> > looking at http://search.cpan.org/search?dist=MailTools
> >
>
> He looked, he saw, he was stumped :-(
> Downloaded the MailTools.
> Typed perl Makefile.PL #ok so far
> typed make #whoops (bad command or filename)
> my perl directory doesn't have a make.exe / make.com / make.bat
> file,nor does the directory where I am installing MailTools
You're using ActiveState on windows? Use the ppm tool to install
modules, or get nmake (look for a post from Ron Savage in clp.modules,
he's got more info, or you might find something on his web site at
http://www.savage.net.au/).
Martien
--
Martien Verbruggen |
Interactive Media Division | I took an IQ test and the results
Commercial Dynamics Pty. Ltd. | were negative.
NSW, Australia |
------------------------------
Date: Tue, 24 Oct 2000 12:00:06 GMT
From: pingu2@my-deja.com
Subject: local binmode?
Message-Id: <8t3tk4$tq9$1@nnrp1.deja.com>
How can I do something like "local binmode STDOUT"? Or can I do something like
$binmode_state = ??? STDOUT;
binmode STDOUT;
...
??? $binmode_state STDOUT ;
Thanks
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 24 Oct 2000 08:46:23 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: local binmode?
Message-Id: <39F592AF.E1445BF6@home.com>
pingu2@my-deja.com wrote:
>
> How can I do something like "local binmode STDOUT"?
Which would (you hope) do what?
> Or can I do something like $binmode_state = ??? STDOUT;
> binmode STDOUT;
> ...
> ??? $binmode_state STDOUT ;
Perlhaps you should consult the documentation.
perldoc -f binmode
(And 'perldoc -f local' as well, since you seem confused about what it
is for.)
Taking a SWAG[1] at what you're after, I think you want to duplicate
STDOUT using another (probably local) filehandle and then binmode()
that, because you can't undo binmode(). Something like this:
# CAUTION: COMPLETELY UNTESTED!
{
local *BSTDOUT;
open(BSTDOUT ">&STDOUT") or die "Couldn't dup STDOUT [$!]\n";
binmode(BSTDOUT);
# ...
close(BSTDOUT);
}
[1] Seriously Wild Ass Guess
-mjc
------------------------------
Date: Tue, 24 Oct 2000 14:57:04 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: local binmode?
Message-Id: <slrn8vb8pp.duj.tjla@thislove.dyndns.org>
I was shocked! How could pingu2@my-deja.com <pingu2@my-deja.com>
say such a terrible thing:
>How can I do something like "local binmode STDOUT"? Or can I do something like
>$binmode_state = ??? STDOUT;
>binmode STDOUT;
>...
>??? $binmode_state STDOUT ;
Why the heck would you want to do something like that? Either a file is
binary or it isn't. WHat's the point of switching half way through?
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
There was a young man of Khartoum
Who lured a poor girl to her doom.
He not only fucked her,
But buggered and sucked her--
And left her to pay for the room.
------------------------------
Date: Tue, 24 Oct 2000 16:53:19 +0200
From: "Matthijs van Duijvenbode" <matthijs@vanduijvenbode.com>
Subject: Make me a hot or not script
Message-Id: <8t47r0$tf0$1@enterprise.cistron.net>
Hello,
I need to find a cgiprogrammer to do a proposal to build a script similar to
that one can see at www.amihotornot.com.
(Perl, UNIX) I´m looking for someone who can give me a fixed price.
Matthijs.
------------------------------
Date: Tue, 24 Oct 2000 14:53:25 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: New to Perl, Need Help !
Message-Id: <slrn8vb8it.duj.tjla@thislove.dyndns.org>
I was shocked! How could Arie van Wingerden <a.vanwingerden@pcmuitgevers.nl>
say such a terrible thing:
>in order to check the ip adressess, you could:
> 1. use function split with the dot (.) as the separator character on
>both ip-adresses, like:
I suggest you check the documentation on split:
perldoc -f split
split /PATTERN/,EXPR,LIMIT
split /PATTERN/,EXPR
split /PATTERN/
You'll notice the first argument is a pattern, not a string. This
doesn't do what you expect.
> @ipo = split('.',$ipoaip);
That should then be (with explicit regex delimiters to make it more
obvious):
@ipo = split /\./, $ipoaip;
> 3. instead of comparing the input directly, you should check whether
>each digit group in both ip-adresses consist of digits 0..9 (use a regex),
>like:
> foreach $dgroup (@ipo) {
> unless ($dgroup =~ /^[0-9]{1,3}$/) {
> die "Invalid digit group";
> }
> }
Why not use the equivalent character class:
$dgroup =~ /^\d{1,3}$/;
Saves on typing.
> 4. then compare the digit groups of both ip-adressess one by one
>numerically (using == not eq)
Ick. Why not just compare the string representations of both once, using
'eq'?
>P.S. I am also a newbie with Perl ;-)
Well it's good that there are so many new people learning to use Perl,
however I suggest that until you know a bit more about it, that before
you make a suggestion, you should test the code that you post. And don't
make any suggestions till you know the documentation a bit better,
otherwise you are likely to do more harm than good.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Every action is either strong or weak, and when every action is strong
we are successful.
-Wallace D. Wattles
------------------------------
Date: Tue, 24 Oct 2000 13:58:10 GMT
From: nvp@spamnothanks.speakeasy.org (NP)
Subject: Re: OT: Jihad definition
Message-Id: <SzgJ5.37316$UP5.572633@news6.giganews.com>
jkline@one.net wrote:
:
: Given that the Arab world gave us algebra, preserved/advanced
: chemistry, and preserved a lot of the Greek texts, I tend to defer to
: the benefits the Moors had. Of course, there are plenty in the Muslim
: world that preach violence.
I prefer to think of them as MOOPS, bubble boy! :-)
--
Nate II
------------------------------
Date: Tue, 24 Oct 2000 07:54:02 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: OT: Jihad definition
Message-Id: <39F5A28A.966FA149@vpservices.com>
NP wrote:
>
> jkline@one.net wrote:
> :
> : Given that the Arab world gave us algebra, preserved/advanced
> : chemistry, and preserved a lot of the Greek texts, I tend to defer to
> : the benefits the Moors had.
Good points, Joe.
> I prefer to think of them as MOOPS, bubble boy! :-)
I have no idea what a MOOP is or what the smiley in that sentence means,
but in a world where people are murdered every day because of their
religion or ethnicity, I find nothing funny in your reply nor in the
original reference to a Jihad as a synonym for terrorism, nor in the
attempt to make fun of someone's "foreign" sounding name.
--
Jeff
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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.
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 V9 Issue 4709
**************************************