[17910] in Perl-Users-Digest
Perl-Users Digest, Issue: 70 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 16 11:05:37 2001
Date: Tue, 16 Jan 2001 08:05:08 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <979661108-v10-i70@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 16 Jan 2001 Volume: 10 Number: 70
Today's topics:
aix suid perl problem <prlawrence@lehigh.edu>
change STDIN and $/="" script to use <madebeer@igc.apc.org>
Fetching server's hard-disk with Perl -nancy-@libero.it
Installing Module <Waarddebon@chello.nl>
Re: Installing Module (Bernard El-Hagin)
Jumbling words <lmoran@wtsg.com>
Re: More questions about pattern matching (Tad McClellan)
MUA in perl? <ball@merck.com>
Re: Newbie question: hash tables and dbm files; what am <brosson@my-deja.com>
Re: Newbie question: hash tables and dbm files; what am (Garry Williams)
Re: Newbie question: hash tables and dbm files; what am (Garry Williams)
Re: Newbie question: hash tables and dbm files; what am <peb@bms.umist.ac.uk>
Re: Perl and AOL. How is this possible? (Tad McClellan)
Re: Random Numbers with a Twist Gordon.Haverland@agric.gov.ab.ca
Re: What do you call the => operator? <joe+usenet@sunstarsys.com>
Re: What do you call the => operator? (Csaba Raduly)
Re: What do you call the => operator? (Tad McClellan)
What's wrong with this (parent fork multiple children)? <davesisk@ipass.net>
Re: What's wrong with this (parent fork multiple childr <davesisk@ipass.net>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 16 Jan 2001 08:19:30 -0600
From: "Phil R Lawrence" <prlawrence@lehigh.edu>
Subject: aix suid perl problem
Message-Id: <941l9i$fia@fidoii.CC.Lehigh.EDU>
Hello,
After reading perldoc perlsec, I made a perl script and had our sysadmin
chown, chgrp, and chmod it appropriately (?).
When I run it, however, $> remains the same as $<.
Details:
-rwsr-x--- 2 owner group 7171 Jan 15 16:10 file_name.pl
I su to another user so group is my primary group. I run the script. It
reports $< and $> remain the same as the user I su'd to, ala:
print "TEST: real user - $<\n";
print "TEST: eff user - $>\n";
From what I've read I need do nothing within the script itself to make the
suid thing work... I just have to accomodate the consequences (tainting,
etc).
Any ideas on what is wrong?
Thanks,
Phil R Lawrence
"I should have used a hash."
------------------------------
Date: Tue, 16 Jan 2001 07:25:41 -0800 (PST)
From: Michael de Beer <madebeer@igc.apc.org>
Subject: change STDIN and $/="" script to use
Message-Id: <APC&1'0'50775de3'669@igc.apc.org>
I wrote a program (below) that:
Parses a single message on STDIN and writes a summary to a file in
$notedir/$msgid, and also outputs a complete copy of msg to STDOUT
(possibly slightly modified).
The problem, is that I have 15,000 messages to run this script on, and I'm
afraid my ISP might get mad if I started up 15,000 perl processes by:
# cat mailfolder(s) | formail -s msg2note2.pl >> mailfolder_with_notes
I'd like to convert my code from being able to handle one message to
handling a whole mbox-format mailbox. In mbox format mailboxes, messages
are seperated by a line that starts with 'From ', like:
>From bob@some.org Mon Dec 11 20:17:47 2000
I thought I could encase most of my code in a subroutine, called
parse_one_message , and that this subroutine could just return if it
detected it was about to read the From line of the next message. Then I
could do &parse_one_messages while (<>);
My main difficulty is that in part D) of my code, I parse the body in
paragraph chunks. If I detect with regexp that the chunk I've just
'eaten' has a 'From this@seperator date' line, that chunk will have the
whole of the headers for the next message.
Any suggestions?
Thank you in advance,
Michael
---------------------------------
#!/usr/bin/perl -w
use strict;
# Index of this script:
# - A) config and programmer notes
# - B) parse header (look for message-id in headers)
# - C) msgid cleanup (define a safe variable $notedir/$msgid)
# - D) parse body (and assemble $note)
# - E) create file $notedir/$msgid
# if you want a NOTE that looks different from mine, edit D)
# -------------- A) config and programmer notes
# the only configuration you _need_ is to change $myhome
my $myhome = '/home/root204';
my $sep = '/';
my $notedir = $myhome . $sep . 'notes';
-d $notedir or die "please create $notedir";
# this script is a 'helper' for mhonarc www.mhonarc.org
# in mhonarc, you can create a 'note' for each message
# I use this to make a user-preferred summary of the message.
# if you want to process STDIN, run it like
# cat msg | msg2note2.pl > msg_with_id_for_sure
# if you want to process a mail folder like this, run it like
# formail -s msg2note2.pl >> mailfolder_with_ids < mailfolder
my ($overwrite); # will overwrite any existing notes if 1
# $overwrite = 1;
my ($quiet); # will be quiet about warning if 1
$quiet = 1;
# -------------- B) parse header
# read until we leave the header, looking for msgid
my @header;
my (%fields);
while ( <> ) {
last if /^$/;
push @header, $_;
chomp;
$fields{ message } = $1 if /^message-id: (.*)/i;
$fields{ msg } = $1 if /^msg-id: (.*)/i;
$fields{ content } = $1 if /^content-id: (.*)/i;
}
# -------------- C) msgid cleanup
my ($msgid);
$msgid = $fields{message} || $fields{msg} || $fields{content};
if (defined($msgid)) {
if ($msgid =~ /<([^>]*)>/) {
$msgid = $1;
} else {
$msgid =~ s/^\s+//;
$msgid =~ s/\s+$//;
}
} else {
# create bogus ID if none exists (code comes from MHONARC)
eval {
# create message-id using md5 digest of header;
# can potentially skip over already archived messages w/o id
require Digest::MD5;
$msgid = join("", Digest::MD5::md5_hex(join '', @header),
'@NO-ID-FOUND.mhonarc.org');
};
if ($@) {
# unable to require, so create arbitary message-id
$msgid = join("", $$, '.', time, '.', $_,
'@NO-ID-FOUND.mhonarc.org');
}
push @header, "Message-ID: $msgid\n";
}
print @header, "\n";
# -------------- D) parse body
# Here I parse the mail message body, looking for a good summary.
# Different types of messages will have different looking 'good' summaries.
# On the news releases I saw, most of the good summaries ended with a period,
# followed by a blank line.
# This isn't perfect, but it worked for most of my messages.
# I may want to revise this once I understand MIME better.
$/ = ""; # read by paragraphs in the body
my $note = '';
while ( <> ) {
print $_;
next if ( length($note) gt 300 );
# grab following paragraph if we have one short but good paragraph.
next unless ( $note or (! /^[^ ]: / and /(\.|\?)"?\s*$/ ));
$note .= $_;
# remove stupid bylines
$note =~ s/---+[^-]*---+//g;
# be sure to remove <>"\ from the note, or it could mess up HTML
$note =~ tr/"/'/;
$note =~ s (\<|\>) ()g;
};
# -------------- E) write $notedir/$msgid
my $notefile = $notedir . $sep . $msgid;
# sanity check
if (-e $notefile and ! $overwrite ) {
print STDERR "$notefile ... exists\n" unless $quiet;
exit;
}
open (NOTE, ">" . $notefile) or die "could not create $notefile";
print NOTE substr ( $note, 0,600);
close (NOTE) or die "could not create $notefile";
__END__
------------------------------
Date: Tue, 16 Jan 2001 15:25:23 GMT
From: -nancy-@libero.it
Subject: Fetching server's hard-disk with Perl
Message-Id: <3a64681f.17002689@news.tin.it>
Hi
I'm trying to write a perl script
who indexes the content of a web server's hard disk
simply by typing an URL.
The script has to list all the files on the server's hard disk
on which that URL is hosted.
Is it possible to do so ? If so, do I have to use LWP ?
Please give me directions, thanks
Joseph
------------------------------
Date: Tue, 16 Jan 2001 14:19:18 GMT
From: "Waarddebon" <Waarddebon@chello.nl>
Subject: Installing Module
Message-Id: <GLY86.709805$%C1.8789805@Flipper>
Can anyone tell me how I can install modules on hypermart ?
I would like to install the Time::Local module, but I've got no clue how to
do this.
Regards,
Mike
------------------------------
Date: Tue, 16 Jan 2001 14:23:11 +0000 (UTC)
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: Installing Module
Message-Id: <slrn968ma8.2q0.bernard.el-hagin@gdndev25.lido-tech>
On Tue, 16 Jan 2001 14:19:18 GMT, Waarddebon <Waarddebon@chello.nl> wrote:
>Can anyone tell me how I can install modules on hypermart ?
What's a "hypermart"?
>I would like to install the Time::Local module, but I've got no clue how to
>do this.
Download the module, unpack it, read the README that comes with it. It
tells you step by step what to do.
Cheers,
Bernard
--
perl -le'* = =[[`JAPH`]=>[q[Just another Perl hacker,]]];print @ { @ = [$ ?] }'
------------------------------
Date: Tue, 16 Jan 2001 11:00:47 -0500
From: Lou Moran <lmoran@wtsg.com>
Subject: Jumbling words
Message-Id: <8dr86tco1dkqoqdtk4r9r5509i9hvrp63o@4ax.com>
--I have been reading the "Code Breaking" thread (which deals with
replacing letters with "something") and it got me to thinking about
jumbling words.
--How could I take BAR and turn it into a list of all of the possible
versions of that word? (meaning:
BAR
BRA
ARB
ABR
RBA
RAB)
--I don't know what that process is called so finding it in the Docs
is fairing poorly.
--please shove me in the right direction.
lmoran@wtsgSPAM.com
print "\x{263a}"
------------------------------
Date: Tue, 16 Jan 2001 08:49:19 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: More questions about pattern matching
Message-Id: <slrn968kav.faa.tadmc@tadmc26.august.net>
Mike McPherson <hafateltec@hotmail.com> wrote:
>#!/usr/bin/perl -w
use strict; # you should have this in *all* of your Perl programs
[ something horrid has happened to the indenting of your code.
Please figure out how to fix that before posting any more code.
]
>unless ($validip =~
>/^[0-2][0-5]{2}.[0-2][0-5]{2}.[0-2][0-5]{2}.[0-2][0-5]{2}/) {
^^^^^
You allow one of only six characters at that position: 0 1 2 3 4 5
Did you know that if
$validip = "000000000000000\n";
Then you would report it as a _valid_ IP?
Dot is special in a regex. If you want a literal dot you need
to backslash it.
Did you know that if
$validip = "255.255.255.12\n";
Then you would report it as an _invalid_ IP?
>As I read I am seeing more and more on how to do this regexp but there are
>still some things that I am not sure on.
regexes work on _strings_.
You want to interpret some of those strings as numbers instead of
strings. You get perl to convert the string to a number for you
by using one of Perl's _numeric_ operators.
So you have 2 parts to your problem:
1) pattern match to find strings that 'look like' IPs
2) interpret each quad-part as a number using numerical
comparison operators.
>For example the above will validate a number such as 111.111.111.111 yet it
>will not validate 249.249.249.249 ::
^
You do not allow a 9 character there. You allow only the 6 above,
so the match must fail.
When in "regex land" digits are just characters like any other,
they are not interpreted any differently from non-digit characters.
>unless ($phone =~ /\d{3}-\d{4}/) {
>Works great right... But what if I wanted to make sure that xxx-xxxx
>
>^^^^ = 0001 to 3999 ???
Your silly word wrapping has broken your underlining too. We
cannot see what you have underlined.
Please figure out how to fix that before using underlining again.
Then you write code that does that. Checking numeric values is
going to require the use of numeric operators:
if ( $phone =~ /^\d{3}-(\d{4})$/ ) {# first do a "looks like" patmat
if ( $1 >= 1 and $1 <= 3999 ) # then use numeric relational operators
{ print "'$phone' is OK\n" }
else
{ print "'$phone' is out of range\n" }
}
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 16 Jan 2001 10:46:13 -0500
From: mine <ball@merck.com>
Subject: MUA in perl?
Message-Id: <3A646CC2.7273D711@merck.com>
Does anyone know of a mail user agent in perl perl/tk? I've been using
zmail for several years but am moving to a new computer and the existing
MUA's (elm,exmh, etc.) aren't to my liking and Netscape isn't anywhere
close. I had a look at CPAN and couldn't find anything relevent and the
comp.mail.xxx groups don't have any information either. So I'm wondering
if there is anything in development.
TIA,
Rich
The contents of this message express only the sender's opinion.
This message does not necessarily reflect the policy or views of
my employer, Merck & Co., Inc. All responsibility for the statements
made in this Usenet posting resides solely and completely with the
sender.
------------------------------
Date: Tue, 16 Jan 2001 14:12:48 GMT
From: Brian <brosson@my-deja.com>
Subject: Re: Newbie question: hash tables and dbm files; what am I doing wrong?
Message-Id: <941ksn$kps$1@nnrp1.deja.com>
I've had the same experience, it's frustrating. I finally read that
you can't save hashes of hashes in a dbm file. It was very difficult
to locate any reference material that addresses this.
Brian
In article <yXS86.2625$d25.15703@newsfeed.slurp.net>,
"James Kauzlarich" <nospam-abuse@[127.0.0.1]> wrote:
> Ok, I'm trying to manipulate some dbm files, the first two programs I
> cobbled together work fine, the 2nd two do NOT. I'm getting very
> frustrated. Do the dbm files NOT work with Hashes of hashes??
>
> These two programs work as expected: (print out the orders.db file,
but I
> do include a printout of dbprint)
>
> =====================================
> [jamesk@tux jamesk]$ cat dbman
> !#/usr/bin/perl
>
> dbmopen (%data, "orders", 0666);
> print "What is your name?\n";
> $name = <STDIN>;
> chomp($name);
> print "What is your order?\n";
> $ord = <STDIN>;
> chomp($ord);
> $data{$name} = $ord;
> print "you said $data{$name}";
> $data{'googookaka'} = "Big Mac";
>
> dbmclose (%data);
> print "\n\n";
>
> =====================================
>
> [jamesk@tux jamesk]$ cat dbprint
> !#/usr/bin/perl
>
> print "\nOutput:\n";
> dbmopen (%data, "orders", 0777);
> foreach (keys %data) {
> print "$_ ordered a: $data{$_}\n";
> }
> dbmclose (%data);
> print "bye!\n";
>
> =====================================
>
> [jamesk@tux jamesk]$ perl dbprint
>
> Output:
> Jim ordered a: Yoohoo
> googookaka ordered a: Big Mac
> dog ordered a: cat
> jacko ordered a: rabbit
> jacko rabbit ordered a: ree
> Dan ordered a: Diamond
> big john ordered a: car
> carrot ordered a: ear
> Pain in the arse ordered a: Nitting needle
> bye!
>
> =====================================
>
> As expected, dbman accepts input, updats the orders.db file, then
prints out
> the contents of the %data hash table.
>
> BUT The following programs are giving me fits: (You will see some
html
> intersperced throughout the code, though I've removed most of it while
> trying to track down where I'm messing up. I'm trying to write a
> 'foodorder' program that will sit on my webpage, and allow all my co-
workers
> to (once we've agreed on where to order from) place food orders.
Eventually
> I may have it build it's own db of prices by places, then you just
select
> what you want. But that is far far in the future for now.)
>
> =====================================
> [jamesk@tux dbcrap]$ cat works.pl
> #! /usr/bin/perl
> #dbmopen (%food, "orders3", 0666);
> %food = (
> me=>
> {
> bread => "1",
> water => "0"
> },
>
> dan=>
>
> {
> rice => "1",
> green_tea => "1"
> },
>
> genome=>
> {
> pizza => "15",
> "dr pepper" => "1"
> },
> );
>
> foreach $x ( keys %food )
> {
> print "\n$x ordered the following:\n";
> foreach ( keys %{$food{$x}} )
> {
> print "$_ costs \$$food{$x}{$_}\n";
> }
> print "\n";
> }
> #dbmclose (%food);
>
> =====================================
> Gives me the following output (as expected):
> [jamesk@tux dbcrap]$ perl works.pl
>
> me ordered the following:
> water costs $0
> bread costs $1
>
> genome ordered the following:
> dr pepper costs $1
> pizza costs $15
>
> dan ordered the following:
> green_tea costs $1
> rice costs $1
>
> =====================================
> but, simply un-comment out the dbmopen/close commands, and the
following
> output results:
>
> me ordered the following:
>
> dan ordered the following:
>
> genome ordered the following:
>
> =====================================
> Whaaaa! Splain it to me Ricky!
>
> One last mystery, if you please, even through I've told it to make
the db
> files -rw-rw-rw- with a 0666, I've been getting -rw-rw-r--, though
they seem
> to work fine (for now, from a command line). What's going on?
>
>
--
Brian R.
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Tue, 16 Jan 2001 15:11:26 GMT
From: garry@zvolve.com (Garry Williams)
Subject: Re: Newbie question: hash tables and dbm files; what am I doing wrong?
Message-Id: <ywZ86.13$h41.1474@eagle.america.net>
On Tue, 16 Jan 2001 02:41:20 -0500, James Kauzlarich
<nospam-abuse@[127.0.0.1]> wrote:
>Ok, I'm trying to manipulate some dbm files, the first two programs I
>cobbled together work fine, the 2nd two do NOT. I'm getting very
>frustrated. Do the dbm files NOT work with Hashes of hashes??
No. (For some meaning of "NOT work".)
--
Garry Williams
------------------------------
Date: Tue, 16 Jan 2001 15:15:50 GMT
From: garry@zvolve.com (Garry Williams)
Subject: Re: Newbie question: hash tables and dbm files; what am I doing wrong?
Message-Id: <GAZ86.15$h41.1474@eagle.america.net>
On Tue, 16 Jan 2001 13:50:29 -0000, Clyde Ingram
<cingram-at-pjocs-dot-demon-dot-co-dot-uk> wrote:
>James Kauzlarich <nospam-abuse@[127.0.0.1]> wrote in message
>news:yXS86.2625$d25.15703@newsfeed.slurp.net...
>> Ok, I'm trying to manipulate some dbm files, the first two programs I
>> cobbled together work fine, the 2nd two do NOT. I'm getting very
>> frustrated. Do the dbm files NOT work with Hashes of hashes??
>
>I recall a problem with DBM files failing to support s hashes of hashes in,
>er.., possibly ActiveState 5.22.
What does "support s hashes of hashes" mean? A hash stores a scalar.
A tied (NDBM_File) hash stores a scalar in the dbm file. What would
you have it do?
This has nothing to do with ActiveState.
>Reason was that DBM files supported scalar values only. If the value was
>not a scalar but a reference to another hash (or array), the DBM file did
>not work as expected.
I wonder what "work as expected" means?
>Remedy was to get a module from CPAN (or was it the O'Reilly Perl Resource
>Kit?) to support references in hash elements.
The remedy is to serialize your data structure before storing it as
the value in a dbm record.
--
Garry Williams
------------------------------
Date: Tue, 16 Jan 2001 14:10:24 +0000
From: Paul Boardman <peb@bms.umist.ac.uk>
Subject: Re: Newbie question: hash tables and dbm files; what am I doing wrong?
Message-Id: <3A645650.4C44ABAC@bms.umist.ac.uk>
James Kauzlarich wrote:
>
> Ok, I'm trying to manipulate some dbm files, the first two programs I
> cobbled together work fine, the 2nd two do NOT. I'm getting very
> frustrated. Do the dbm files NOT work with Hashes of hashes??
<snip programs>
> One last mystery, if you please, even through I've told it to make the db
> files -rw-rw-rw- with a 0666, I've been getting -rw-rw-r--, though they seem
> to work fine (for now, from a command line). What's going on?
I think the problem is that you aren't using a DBM module that only lets
you store scalars in your DBM file. Have a look at the MLDBM module
from CPAN. This lets you store complex data in a DBM file.
Paul
------------------------------
Date: Tue, 16 Jan 2001 08:00:53 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Perl and AOL. How is this possible?
Message-Id: <slrn968hg5.faa.tadmc@tadmc26.august.net>
G.A.D.Miles <usad1@gadnet.com> wrote:
>On 14 Jan 2001 00:40:14 GMT, abigail@foad.org (Abigail) wrote:
>
>>G.A.D.Miles (usad1@gadnet.com) wrote on MMDCXCII September MCMXCIII in
>><URL:news:3a605397.7747790@news.newsguy.com>:
>>.. works fine in all browsers. However, if you right click on a banner
>>.. and opt to open the page in a new browser window, it works fine in IE
>>.. and Netscape, but in AOL the script cannot find the site and returns
>>.. the default URL location.
>>.. How can this be possible since it is the server, not the browser that
>>.. is running the code?
>>
>>According to your status problem, the program can't find a site.
>>
>>Or are you utterly clueless and should you be asking in a browser group?
>
>I am asking here because, in a nutshell, a Perl script is operating in
>different ways under different browsers.
Perl does not operate "under a browser" in ANY circumstance.
CGI programs run on the _server_ as Abigail pointed out.
Browsers are only an input/output device.
If a particular browser is not displaying the output of your
CGI program properly, then you have a browser question, not
a Perl question.
You should ask browser questions in a browswer newsgroup, that is
where the folks likely to be able to answer your question hang out.
This newsgroup is for discussing Perl, not web browsers.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 16 Jan 2001 14:28:39 GMT
From: Gordon.Haverland@agric.gov.ab.ca
Subject: Re: Random Numbers with a Twist
Message-Id: <3a6457ac.419332713@news.gov.ab.ca>
>"Shawn Coppock" <coppocks@bellsouth.net> writes:
>> #Problem:
>>
>> Lets say I need to generate 60 random pairs of numbers ($x,$y) ...
>> where $x is from a range of 1..1200 and $y is from a range of 1..800.
>> Consider these pairs as a random point or coordinate on a grid of
>> 1200x800.
>> In addition to this, each pair must be unique, in that
>> 1. no pair can be the same
>> 2. no pair can be within 30 of another
>> I don't want the pairs/coordinates to be perfectly spaced by 30. There's
>> no need because at 1200x800 there are 960k available points... and if no
>> two are within 30 of another, there are still 320k possibilities.
I don't think you can solve this without some kind of rejection
mechanism, i.e. you calculate a trial (x,y) and test to see if there
are already found points within a radius of 30 (or rather, a radius
squared of 900).
One thing you can do, is to "wrap" (tile ?) your data space using
modular arithmetic. So, if we are going to try adding 57 units in the
X direction to a point which is already at 1190, we get 47
(1190+57-1200).
A new trial point in X would be a uniform deviate on the interval
(-1140 ... +1140). If the value is less than zero, we add 30 to its
magnitude (now it is -30 ... -1170), and add this negative value to
the X coordinate we already have. Do a similar thing with your Y
coordinate on the interval (-740 ... +740). This is assuming you want
to use this 1200x800 space you mentioned above.
As far as the testing goes, I see one of 2 possibilities. First is
you test the distance squared between your test point and all others.
This gets more expensive as you accept more and more points. The
other is that once you accept a point, you black out all grids within
30 of the test point (in a hash). Then, to accept a new point, all
you are doing is if( exists($hash{f(X,Y)}) ). This will have a
constant work per point I think.
Gord
------------------------------
Date: 16 Jan 2001 10:13:59 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: What do you call the => operator?
Message-Id: <m3g0ijy1fs.fsf@mumonkan.sunstarsys.com>
jmcnamara@cpan.org (John McNamara) writes:
> Ar 16 Jan 2001 08:57:28 GMT, do schriobh abigail@foad.org (Abigail):
> >Since <=> is the space ship operator, what about calling => the
> >damaged space ship operator?
>
> And < the damage operator.
No, young jedi. The damage operator is
x
<=> would have been called "the tie fighter" in a
trademark-free universe.
In that same (still male-oriented) universe, Joclyn Elders
would have endorsed <=> in a safe-sex ad to curb
juvenile pregnancies arising from overractive use of
"the binding operator" =~.
--
Joe Schaefer
------------------------------
Date: Tue, 16 Jan 2001 15:29:14 +0000 (UTC)
From: real.email@signature.this.is.invalid (Csaba Raduly)
Subject: Re: What do you call the => operator?
Message-Id: <Xns902B91D84quuxi@194.203.134.135>
And so it came to pass that Uri Guttman <uri@sysarch.com> on 15 Jan
2001 wrote <x7zogszjut.fsf@home.sysarch.com>:
>>>>>> "LW" == Lee Webb <lwebbee@britcomtele.comnotreal> writes:
>
> LW> Programming Perl (3rd Edition): P108
> LW> "The => digraph is mostly just a synonym for the comma
> operator."
>
> LW> Personally, I believe Larry et al ;-)
>
>but there is no name there for it. that is the whole question here.
>
What's in a name ? That which we call a fat arrow by any other word
would separates key/value parts.
(Sorry, Will).
--
Csaba Raduly, Software Developer (OS/2), Sophos Anti-Virus
mailto:csaba.raduly@sophos.com http://www.sophos.com/
US Support +1 888 SOPHOS 9 UK Support +44 1235 559933
You are in a maze of twisted little minds, all different.
------------------------------
Date: Tue, 16 Jan 2001 08:24:26 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: What do you call the => operator?
Message-Id: <slrn968isa.faa.tadmc@tadmc26.august.net>
John McNamara <jmcnamara@cpan.org> wrote:
>Ar 16 Jan 2001 08:57:28 GMT, do schriobh abigail@foad.org (Abigail):
>>Since <=> is the space ship operator, what about calling => the
>>damaged space ship operator?
Now we're getting somewhere:
rocket operator
one-way spaceship (finding *nauts might prove difficult for this one)
sideways house operator
Woody Woodpecker operator (sideways the other way)
quote left bareword then act like a comma operator
operator with the secret name known only to the Cabal
operator whose name we could tell you, but then we'd
have to kill -9 you
>And < the damage operator.
But there already is a Damage Operator, it is just really long to type:
no strict 'refs';
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 16 Jan 2001 15:23:45 GMT
From: "David Sisk" <davesisk@ipass.net>
Subject: What's wrong with this (parent fork multiple children)?
Message-Id: <5IZ86.27204$W82.4100088@typhoon.southeast.rr.com>
$children = 2;
$cpid = -1;
for ($i = 1; $i = $children; $i = $i + 1) {
if ($cpid !=0) {
if (!defined($cpid = fork())) { die "cannot fork: $!" };
}
}
What I want to do is have the parent fork x children (in this case 2).
Instead, I get the parent forking children and the children forking more
children (essentially, a forking infinite loop) [pun intended]. I'm trying
to prevent the children from forking more children with the "if ($cpid
!=0)", but that doesn't seem to work. Can anyone point me in the right
direction? What am I doing wrong here?
Best regards,
Dave
------------------------------
Date: Tue, 16 Jan 2001 15:49:28 GMT
From: "David Sisk" <davesisk@ipass.net>
Subject: Re: What's wrong with this (parent fork multiple children)?
Message-Id: <c4_86.27209$W82.4113189@typhoon.southeast.rr.com>
I've also tried this:
$ppid = $$;
for ($i = 1; $i = 2; $i = $i + 1) {
if ($ppid == $$) {
if (!defined($cpid = fork())) { die "cannot fork: $!" };
}
}
Here I'm attempting to say "if my process_id is the same as the original
process, then fork". This doesn't seem to work as intended either. Any
ideas?
Regards,
Dave
David Sisk <davesisk@ipass.net> wrote in message
news:5IZ86.27204$W82.4100088@typhoon.southeast.rr.com...
> $children = 2;
> $cpid = -1;
> for ($i = 1; $i = $children; $i = $i + 1) {
> if ($cpid !=0) {
> if (!defined($cpid = fork())) { die "cannot fork: $!" };
> }
> }
>
>
> What I want to do is have the parent fork x children (in this case 2).
> Instead, I get the parent forking children and the children forking more
> children (essentially, a forking infinite loop) [pun intended]. I'm
trying
> to prevent the children from forking more children with the "if ($cpid
> !=0)", but that doesn't seem to work. Can anyone point me in the right
> direction? What am I doing wrong here?
>
> Best regards,
> Dave
>
>
>
------------------------------
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 V10 Issue 70
*************************************