[8383] in Perl-Users-Digest
Perl-Users Digest, Issue: 2000 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 2 04:07:31 1998
Date: Mon, 2 Mar 98 01:00:39 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 2 Mar 1998 Volume: 8 Number: 2000
Today's topics:
"Locking" a variable? <usenet_post@bradfitz.com>
Re: "Locking" a variable? <uri@sysarch.com>
Re: "PERL" puzzle. <abc@1coolplace.com>
ANNOUNCE: IndexMaker 5.0: an index.html maker from PDF, <pivari@geocities.com>
Re: Conflict in this Newsgroup <merlyn@stonehenge.com>
Courthouse and Perl <bridges@brightok.net>
Re: Courthouse and Perl (Craig Berry)
Deval::Coverage - how to run? (Michelle Sihdu)
Error when generating Perl 5.0004.04 on OpenVMS 6.2 <Bernt.M.Johnsen@novit.no>
graphics malinet@loom.net.au
Re: Image question <rets@meta3.com>
opportunity for perl programmers <jwoods@globalsight.com>
Re: Passing an argument to a perl script. Frank@but_dont_use_this.address
Re: Perl and the mSQL Interpreter <netnuevo@best.com>
Re: Perl Scripts which extract info from HTML pages (Abigail)
Re: Search script logic <ebohlman@netcom.com>
Re: Stripping (Most) HTML tags <peter.edlund@home.se>
Re: system(command) = fork + exec(command)? kill parent (Barninga Z!)
Re: system(command) = fork + exec(command)? kill parent <barmar@bbnplanet.com>
Re: Upgrading from Perl 4 to Perl 5 - Differences? <merlyn@stonehenge.com>
Which database system to use? <andreas.greulich@mbox.bfi.admin.ch>
XEmacs Perl mode w prototypes? <andreas.greulich@mbox.bfi.admin.ch>
Re: XEmacs Perl mode w prototypes? (Ilya Zakharevich)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 1 Mar 1998 23:11:35 -0800
From: "Brad Fitzpatrick" <usenet_post@bradfitz.com>
Subject: "Locking" a variable?
Message-Id: <6ddlte$se3$1@news1.teleport.com>
Question:
I'm curious if it's possible to lock a variable from being modified. I have
sections in a program that inject other bits of perl into a separate
namespace. I want the injected Perl to have 'read only access' to the
main:: namespace, so to speak.
Any clues? Places to look? I skimmed over some documentation for Safe Perl
but wasn't quite sure if that's what I need, or if I need that much
overhead.
Thanks in advance,
Brad Fitzpatrick
------------------------------
Date: 02 Mar 1998 03:06:22 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: "Locking" a variable?
Message-Id: <x7ra4lzfcx.fsf@sysarch.com>
"Brad Fitzpatrick" <usenet_post@bradfitz.com> writes:
> Question:
>
> I'm curious if it's possible to lock a variable from being modified. I have
> sections in a program that inject other bits of perl into a separate
> namespace. I want the injected Perl to have 'read only access' to the
> main:: namespace, so to speak.
look for CPAN Tie::Watch. it can do just that.
uri
--
Uri Guttman SYStems ARCHitecture and Software Engineering
uri@sysarch.com Have Perl, Will Hack
http://www.sysarch.com (781) 643-7504 x*2 FAX: (781) 643-2710
Try the Best Search Engine on the Net --------> http://www.northernlight.com
------------------------------
Date: Sun, 01 Mar 1998 20:51:36 +0000
From: Albert Jones <abc@1coolplace.com>
Subject: Re: "PERL" puzzle.
Message-Id: <34F9CA58.5F74@1coolplace.com>
Andy Lester wrote:
>
> : ###########################################
>
> : #!/usr/bin/perl
>
> : &lv($i,my($self));
>
> : $want=&lv($u,$me);
>
> It's "I Touch Myself" by the Divinyls.
>
Hehe. Thanks for the humor! <grin>
AJ
------------------------------
Date: Mon, 02 Mar 1998 10:26:58 +0000
From: Fabrizio Pivari <pivari@geocities.com>
Subject: ANNOUNCE: IndexMaker 5.0: an index.html maker from PDF,HTML,VRML and other files
Message-Id: <34FA8971.FE01FB0@geocities.com>
Hi,
I'm glad to announce the version 5.0 of IndexMaker a perl script to make
an index.html file from PDF, HTML, VRML and other files.
At the moment, it uses the /Author field, the first /Title field and in
the /Subject field
every matched PDF files, the <TITLE> </TITLE> field and the META
Description and Author fields
in every matched HTML files the Info node field in every matched VRML
1.0 files
the WorldInfo node field info and title in every matched VRML 2.0 files
and the name of the file in the others.
What's new with version 5.0
The code was rewrited in PERL 5.xxx mode
Now I don't support directly PDF. I use the new PDF libray v.1.04 of
Antonio Rosella
http://www.geocities.com/CapeCanaveral/Hangar/4794/
This is the URL where you can find the tool
http://www.geocities.com/CapeCanaveral/Lab/3469
--
Fabrizio Pivari
mailto:pivari@geocities.com
http://www.geocities.com/CapeCanaveral/Lab/3469/
Member of ANFACE Software
http://www.geocities.com/CapeCanaveral/Hangar/4794/
------------------------------
Date: 01 Mar 1998 22:21:25 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Conflict in this Newsgroup
Message-Id: <8cu39hekh6.fsf@gadget.cscaper.com>
>>>>> "Nathan" == Nathan V Patwardhan <nvp@shore.net> writes:
Nathan> The fact is that the experts have tried really, really hard to
Nathan> preserve the Usenet culture that many of us were a part of in its
Nathan> "hey day" and are probably burned out from having done so. I don't
Nathan> remember Tom or Randal or anyone else freaking out *at all* four
Nathan> or five years ago.
This is accurate. I am *continually* *appalled* at the "take and no
give" attitude prevailing in most Usenet groups these days.
Especially in comp.lang.perl.*, seeing as that's my "home" for the
moment.
Usenet is *not* the help line or the answer desk.
It's the potluck (see earlier post).
It's where you give a little and take a little.
We who might know are *never* under an obligation to answer
*anything*. And if you cry wolf too many times, no-one will be around
to believe you when you need it.
If you think that's a "high and mighty" attitude to take, please read
a few more months before passing judgement. You'll start to see how
80% of the postings in this group are merely FAQs or misdirected
posts, or responses to same. What a *waste*. What a *waste* of a good
medium.
<sigh>
I'm here in hopes that there'll be one or two non-FAQs a day that I
can answer. But it usually takes an hour a day to find that one
useful post. And that doesn't make *any* sense to me. What a *waste*,
both of my time, and your resource.
Sure, the pool can be used as a toilet. But why?
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 183 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Sun, 01 Mar 1998 23:36:06 -0600
From: Butch Bridges <bridges@brightok.net>
Subject: Courthouse and Perl
Message-Id: <34FA4545.E6709453@brightok.net>
I am trying to decide if Perl is the way to go with placing our court
records on the Net so the public can access them. Is it very
complicated? Please reply by email with any suggestions or help. I
really know nothing about doing this. Thanks....... Butch Bridges
bridges@brightok.net
Ardmore, Oklahoma
------------------------------
Date: 2 Mar 1998 06:58:47 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Courthouse and Perl
Message-Id: <6ddlb8$m3m$1@marina.cinenet.net>
Butch Bridges (bridges@brightok.net) wrote:
: I am trying to decide if Perl is the way to go with placing our court
: records on the Net so the public can access them.
What you'll want for this is (presumably) some sort of web database lookup
scheme. There are a multitude of ways to do this, quite a few of which
do involve Perl, many others of which don't. Fundamentally, the issue
isn't about implementation language(s) or application(s), but about what
your requirements are and how in broad outline to solve them. Choices of
what tool(s) to use come in the phase after that (design).
: Is it very complicated?
Yes. It's a programming language, after all. Obviously, a Perl program
*can* be very simple ('print "Hello";' is a valid Perl program), but one
which accomplishes your stated goal (and all the implicit ones behind it)
robustly and maintainably is going to be inherently a bit complicated.
: Please reply by email with any suggestions or help. I
: really know nothing about doing this. Thanks....... Butch Bridges
My honest suggestion is that you hire someone to do this...and no, I'm
not angling for a contract. :) It's too big and complicated a project
for a beginner to handle correctly, in all likelihood. Start with
something smaller, or take over maintenance on the on-line records system
after someone else writes it for you.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: 2 Mar 1998 09:49:18 +0100
From: mi@init.se (Michelle Sihdu)
Subject: Deval::Coverage - how to run?
Message-Id: <6ddrqe$k4p$1@ming.init.se>
Hi
To start with, my name is Michelle and I am tying to use Deval::Coverage.
Perhaps there is somwhere else I should ask my question but so far
I don't know where. If anyone knows where I can find documentation
about this problem just let me know and I'll try it myself.
My problem is that I can't get it, Coverage, to work.
Compilation and installation works fine, no test included in the
tar-package, so no tests done.
What I have done is this, showing comands and output:
#Compiled
>perl5.003 Makefile.pl #was ok
>make #was ok
#Installed
>make install
Installing /opt/pgm/lib/perl5.003/site_perl/./Devel/Coverage/coverperl_prefs.pl.old
Installing /opt/pgm/lib/perl5.003/site_perl/./Devel/Coverage/coverperl_prefs.pl
Installing /opt/pgm/lib/perl5.003/site_perl/./Devel/Coverage/Utils.pm
Installing /opt/pgm/lib/perl5.003/site_perl/./Devel/Coverage.pm
Installing /opt/pgm/man/man1/./coverperl.1
Installing /opt/pgm/lib/perl5.003/man/man3/./Devel::Coverage.3
Installing /opt/pgm/bin/./coverperl
Writing /opt/pgm/lib/perl5.003/site_perl/sun4-solaris/auto/Devel/Coverage/.packlis t
Appending installation info to /opt/pgm/lib/perl5.003/sun4-solaris/5.003/perllocal .pod
#Tried to run it:
>perl5.003 -d:Coverage whatever.pl
No DBsub routine at /opt/pgm/lib/perl5.003/vars.pm line 21.
BEGIN failed--compilation aborted at /opt/pgm/lib/perl5.003/vars.pm line 21.
BEGIN failed--compilation aborted at /opt/pgm/lib/perl5.003/site_perl/Devel/Covera
ge/Utils.pm line 3.
BEGIN failed--compilation aborted at /opt/pgm/lib/perl5.003/site_perl/Devel/Covera
ge.pm line 8.
BEGIN failed--compilation aborted.
#checked the error as good as I could:
line 20 and 21 in /opt/pgm/lib/perl5.003/vars.pm says:
require 5.000;
use Carp;
I am using 5.003, is that a porblem?
#checked other errors I could think about, so I checked:
>perl -V
Summary of my perl5 (5.0 patchlevel 3 subversion 0) configuration:
Platform:
osname=solaris, osver=2.5.1, archname=sun4-solaris
uname='sunos torgdb 5.5.1 generic_103640-05 sun4u sparc sunw,ultra-enterprise '
hint=previous, useposix=true, d_sigaction=define
Compiler:
cc='gcc', optimize='-O', gccversion=2.7.2.2
cppflags=''
ccflags =''
stdchar='unsigned char', d_stdstdio=define, usevfork=false
voidflags=15, castflags=0, d_casti32=define, d_castneg=define
intsize=4, alignbytes=8, usemymalloc=y, randbits=15
Linker and Libraries:
ld='gcc', ldflags =''
libpth=/lib /usr/lib /usr/ccs/lib
libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
libc=/lib/libc.so, so=so
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=, ccdlflags=' '
cccdlflags='-fpic', lddlflags='-G'
@INC: /opt/pgm/lib/perl5.003/sun4-solaris/5.003 /opt/pgm/lib/perl5.003 /opt/pgm/lib/perl5.003/site_perl/sun4-solaris /opt/pgm/lib/perl5.003/site_perl .
and as far as I can see @INC is correct.
Have also checked if COverage.pm contains sub sub, which it does.
I have also tried it on other perl programs:
first.pl calls second.pl and writes some output, really simple.
But the error is the same.
I have no moore ideas what might be wrong, can anyone help me?
Or do anyone knows any other program that will analyse a perl-program.
!!!!!!!! What I want to know is to find out which programs are
called or which files are involved from a specified perl-program. !!!!!
Trying to analyse so that I can make a flow-chart to describe all
dependencies.
Since I have no news where I'am sitting I would appreciate if you
answer me by mail.
answer to: michelle@init.se
Best regards and thanks
/Michelle
------------------------------
Date: 02 Mar 1998 09:25:35 +0100
From: Bernt Marius Johnsen <Bernt.M.Johnsen@novit.no>
Subject: Error when generating Perl 5.0004.04 on OpenVMS 6.2
Message-Id: <uiupxwlc0.fsf@novit.no>
We are using VAX C V3.2-044 and MMK 3.6 and the generation aborts with
CC /Define=(DEBUGGING)/Include=[]/Object=.obj/NoList PERLMAIN.C Copy/Log/NoConfirm [.VMS.EXT]XSSYMSET.PM [.LIB.EXTUTILS]XSSYMSET.PM
%COPY-S-COPIED, PERLSRC:[000000.VMS.EXT]XSSYMSET.PM;1 copied to PERLSRC:[000000.LIB.EXTUTILS]XSSYMSET.PM;1 (15 blocks)
MCR Sys$Disk:[]miniperl.exe "-I[.lib]" [.lib.extutils]xsubpp -noprototypes [.EXT.DYNALOADER]DL_VMS.XS >[.EXT.DYNALOADER]DL_VMS.C
no UTC offset information; assuming local time is UTC.
Insecure dependency in eval while running with -T switch at [.lib.extutils]xsubpp line 1339, <File0000> chunk 356.
%SYSTEM-F-NOLOGNAM, no logical name match
%MMK-F-ERRUPD, error status %X000001BC occurred when updating target [.EXT.DYNALOADER]DL_VMS.C
Does anyone have any ideas of what to do next?
Bernt.M.Johnsen@novit.no
------------------------------
Date: Mon, 02 Mar 1998 19:11:58 +1100
From: malinet@loom.net.au
Subject: graphics
Message-Id: <34FA69CE.8AACDAE2@loom.net.au>
hi,
Can someone please tell me how to load and display a bitmap onto the
screen using perl?? Or at least plot a pixel or draw a cirlce??
thanks,
Adam
Ps,
I would also like to know how to play .au files??
------------------------------
Date: Mon, 02 Mar 1998 00:32:02 -0600
From: Ken Holm <rets@meta3.com>
To: Kelby Valenti <kelby@mplx.com>
Subject: Re: Image question
Message-Id: <34FA5262.64CBB2C3@meta3.com>
You need isize.pl
# File: isize Date: Apr 29, 1996
# Author: Marcus E. Hennecke <marcush@leland.stanford.edu>
# <URL:ftp://ftp.crc.ricoh.com/pub/www/isize>
# JPEG code based in part on rdjpgcom.c by Tom Lane <tgl@netcom.com>
-K
------------------------------
Date: Sun, 01 Mar 1998 22:36:57 -0800
From: Global Sight Corporation <jwoods@globalsight.com>
Subject: opportunity for perl programmers
Message-Id: <34FA5389.635E@globalsight.com>
San Jose start-up is looking for perl programmers, proficient
in perl5.
Ideal candidates will have experience with 5.004,
OOP module authoring, DBI/DBD, CGI.pm, and the
libwww bundle. Experience with mod_perl/Apache,
Binary Evolution's Velocity Engine, or FastCGI is
preferred. C/XSUBs skills are obviously helpful.
Interest/know-how in Java/Perl integration is also
a big plus.
We are unix-centric but occasionally require Sarathy/ActiveState
work as well.
If you are interested, plese e-mail your resume in plain-text
to Jorden Woods, jwoods@globalsight.com.
Thanks.
------------------------------
Date: 02 Mar 1998 07:58:07 +0100
From: Frank@but_dont_use_this.address
Subject: Re: Passing an argument to a perl script.
Message-Id: <yo93eh1shog.fsf@nym.sc.philips.com>
Hello!
(I'm using unix, I have no idea how the situation under NT is. )
I use something like the following approach:
use strict;
use Getopt::Long;
my (%scriptOptions)=();
&GetOptions(\%scriptOptions, "string1=s", "string2=s");
print $scriptOptions{string1};
print $scriptOptions{string2};
you can call your script then:
script_name --string1=its --string2=whatever
use:
perldoc Getopt::Long
to discover the documentation for this.
regards
Frank
------------------------------
Date: Sun, 01 Mar 1998 21:06:18 -0800
From: Stephanie Ray <netnuevo@best.com>
Subject: Re: Perl and the mSQL Interpreter
Message-Id: <34FA3E4A.DA34CD57@best.com>
I didn't want to use the API because I wanted to use Perl, not C. :-)
I guess I have to look into one of the packages, but weren't people using
Perl/CGI/mSQL a long time before DBD came out?
Nathan V. Patwardhan wrote:
> Stephanie Ray (netnuevo@best.com) wrote:
> : Can anyone please tell me how to implement the following statements into
> : Perl? My (unsuccesful) attempt follows... any help would be greatly
> : appreciated.
>
> Don't do it this way. Go to CPAN and get the DBD::mSQL module
> instead. Even if you choose not to use the DBD, I still don't
> understand why you've chosen to work with a pipe of all things --
> particularly since mSQL has an API that's clearly documented.
>
> Not trying to yell at you, but very, very puzzled with your approach.
>
> --
> Nathan V. Patwardhan
------------------------------
Date: 2 Mar 1998 08:40:09 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Perl Scripts which extract info from HTML pages
Message-Id: <6ddr99$9un$3@client2.news.psi.net>
Craig Berry (cberry@cinenet.net) wrote on 1644 September 1993 in
<URL: news:6dda3t$8i8$1@marina.cinenet.net>:
++ Abigail (abigail@fnx.com) wrote:
++ : kmyers@syneractive.com (kmyers@syneractive.com) wrote on 1642 September
++ ^^^^
++ : 1993 in <URL: news:6da6id$fpa$1@nnrp1.dejanews.com>:
++ ^^^^
++
++ Looks like the Y2K bug is even more fiendish than anyone thought...
The number in front of September indicates the number of people
who thought they thought an original joke.
Abigail
--
perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-
------------------------------
Date: Mon, 2 Mar 1998 07:33:44 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Search script logic
Message-Id: <ebohlmanEp6L08.F86@netcom.com>
Nitin Gupta <niting@raleigh.ibm.com> wrote:
: I am in the process of writing a script which searches thru all the html
: pages of a site for keywords, I know there is a score of such scripts
: available for download but I wanted to indulge myself on this one :-)
: I wanted to get ideas on how indexing is done, this particular site I am
: writing this script for has about 3000 pages and I wanted to create an index
: for the site which would be searched instead of opening all the pages and
: searching/matching a keyword (Which is the method employed by almost all
: scripts available on the Net). How does one determine what is a keyword and
: what is not?
You probably want to look at the literature on information retrieval,
which goes back at least 35 years. You want to learn about concepts like
degree of recall (given a query, you want to get as many documents as
possible that "match" the query) and degree of precision (given a query,
you want to get as few documents as possible that don't match the query);
optimizing for one often results in "pessimizing" for the other. You'll
want to do some sort of concept-to-term mapping, so that, for example, a
query for "CGI scripting" also picks up documents that talk about "CGI
programming."
As far as determining what is/isn't a keyword, the simplest way is to
make a list of all the words in a document and then remove any "stop
words" from it, stop words being words that occur in all/almost all of
your documents and therefore lack power to discriminate between
documents. Generating a really good stop-word list requires examining
all the documents in the collection to be indexed (which may be
impossible if that collection is dynamic), but a first approximation is
to determine the N most common words in the language the document is
written in, for some "good" value of N, and put them in the stop-list.
For example, if your documents are in English, then "the," "an" and "of"
are not likely to be valuable keywords, because every single document in
the collection will contain them.
------------------------------
Date: Mon, 02 Mar 1998 09:34:02 +0100
From: Peter Edlund <peter.edlund@home.se>
Subject: Re: Stripping (Most) HTML tags
Message-Id: <34FA6EFA.9DA1A358@home.se>
Tim Archer wrote:
>
> Hi all.
>
> I am looking for a perl script that will strip all tags except for a
> given list from a document.
well, this is not completely tested or anything, I just hacked it
together (testing is left to you as an exercise :-)
prerequisites:
$text should hold the html file's text
@arr should hold the BEGINNING of every tag you want to save
example:
$text = "blahablahalh <a href="blaha.html">FOO</a> ......"
@arr = ('A HREF','/A');
# here's the important part
# create a var that holds all the 'tag-starts' you want
# perl will interpret this as a grouping in the regexp and since
# we use a 'zero negative lookahead' on these we won't strip the
# the important tags.
$foo = join ('|', @arr);
$text =~ s/<(?!($foo)).*?>/igs;
Hope this helps somewhat
//peter.
--
----------------------------------------
- There's more than one way to do it
Peter Edlund, peter.edlund@capgemini.se
UNIX developement consultant
Cap Gemini
------------------------------
Date: Fri, 27 Feb 1998 08:21:01 GMT
From: barninga@fuck.the.spammer (Barninga Z!)
Subject: Re: system(command) = fork + exec(command)? kill parent, children?
Message-Id: <34f6743a.3068909@news.tin.it>
Shashamane!
Please look at the signature for my actual email address...
mwang@alhena.ibk.ml.com (Michael Wang) wrote:
>If system(command) = fork + exec(command),
>then how can I get the PID of exec(command), not the
>PID of the system(command) which is the parent of
>the "command".
assuming C :-)
fork() gives you the child's pid; when the child exec()s a command,
this will overlay the child and also take its pid.
>This also brings up another question. On unix (solaris)
>system, what happens to the children if you kill the
>parent? becomes zombie or killed as well, and what
>determines what will happen? Thanks.
AFAIK (HP-UX and IBM-AIX) children will be orphaned, and "adopted" by
init (that is, their p-pid will become 1); a zombie is a child which
has exited, but whose parent hasn't called wait() yet.
Kumasee
Barninga Z!
Email: barninga @ usa.net / barninga @ geocities.com
Home: http://barninga.base.org
ZMK: http://zmk.base.org
Roxy: http://rossanacasale.base.org
------------------------------
Date: Mon, 02 Mar 1998 08:01:47 GMT
From: Barry Margolin <barmar@bbnplanet.com>
Subject: Re: system(command) = fork + exec(command)? kill parent, children?
Message-Id: <LHtK.6$hY3.37352@cam-news-reader1.bbnplanet.com>
In article <34f6743a.3068909@news.tin.it>,
Barninga Z! <barninga@fuck.the.spammer> wrote:
>Shashamane!
>Please look at the signature for my actual email address...
>mwang@alhena.ibk.ml.com (Michael Wang) wrote:
>
>>If system(command) = fork + exec(command),
>>then how can I get the PID of exec(command), not the
>>PID of the system(command) which is the parent of
>>the "command".
>
>assuming C :-)
>
>fork() gives you the child's pid; when the child exec()s a command,
>this will overlay the child and also take its pid.
But system(command) = fork + exec("/bin/sh -c 'command'"). So the PID is that
of /bin/sh, not "command".
AFAIK, there's no easy way to get the PID of the process executing
command. If you need this, you'll have to do your own fork and exec, and
not use the shell to execute the command.
--
Barry Margolin, barmar@bbnplanet.com
GTE Internetworking, Powered by BBN, Cambridge, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
------------------------------
Date: 01 Mar 1998 22:12:03 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Upgrading from Perl 4 to Perl 5 - Differences?
Message-Id: <8cyaytekws.fsf@gadget.cscaper.com>
>>>>> "I" == I R A Aggie <fl_aggie@thepentagon.com> writes:
I> There should (better?? :) be a CHANGES document in the perl 5 distribution.
I> Someone wrote a "gotcha" list of things between 4 and 5, which should be in
I> the CPAN and somewhere on http://www.perl.com
man perltrap
perldoc perltrap
Or, for those of you that haven't realized that you have ALL the docs
RIGHT THERE on your disk... :-)
http://www.perl.com/CPAN/doc/manual/html/pod/perltrap.html
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 183 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Mon, 02 Mar 1998 08:44:08 +0100
From: Andreas Greulich <andreas.greulich@mbox.bfi.admin.ch>
Subject: Which database system to use?
Message-Id: <34FA6348.A5FA281F@mbox.bfi.admin.ch>
Hi all,
I have written a WWW application for organising business internal
projects. The system is storing info in a database of course. I
downloaded the Sprite package, which works fine and actually I like it a
lot.
My only concern is that, while the database is growing, Sprite might
become inefficient. It is not yet the case, but the database(s) might
grow. An alternative would be using ndbm or similar... but I don't know
if a change would be worth it. So I have to decide between:
- staying with Sprite ("If it works, don't fix it" :-)
- switiching to another database sytem that's available shareware or
already on my
system (Soalris 2.5.1)
- Buying an independent database software like Oracle and use a Perl
interface
(as far as I understood Oraperl and similar require an Oracle server)
Does anybody know about comparisions betwwen teh scenarios? Of course I
know Oracle would be more powerful - but for example, is it worth to
consider something like ndbm or a gnu tool, do these have (performance)
advantages over Sprite? To say that again, the functionality I have with
Sprite is fine, the only concern is performace.
Thanks for your help in advance!
Andy
--
*********************************************************************
Dr. Andreas Greulich
Swiss Federal Office of Information Technology and Systems
Monbijoustr. 74 - CH-3003 Bern - Switzerland
Phone: ++41 31 325 80 86
Fax: ++41 31 325 90 30, ATTN. A.Greulich
Internet: andreas.greulich@bfi.admin.ch
HTTP: http://www.imsv.unibe.ch/~greulich
*********************************************************************
------------------------------
Date: Mon, 02 Mar 1998 08:37:56 +0100
From: Andreas Greulich <andreas.greulich@mbox.bfi.admin.ch>
Subject: XEmacs Perl mode w prototypes?
Message-Id: <34FA61D4.6CB92359@mbox.bfi.admin.ch>
Hi all,
I'm using Perl 5.004 and XEmacs 20.3 with CPerl mode. It works fine and
mainly I like it... the only problem I have is that the perl mode does
not recognize deveral syntax features. The most annoying thing is that
after every line of the form "sub xxx($);" (ie, after each prototype),
it automatically indents. I have automatical indentiung turned on
because I like the feature. Is there a way, or a version ofd perl mode,
that knows about proitotypes? Also, with the auto-lf mode, it
automatically linefeeds after typing the } sign in "$x{aa}" when I plan
to write "$x{a}=4;". Thsi is not that important as I probably won't use
this mode any longer. The auto indent is quite useful though...
Thanks for your help!
Andy
--
*********************************************************************
Dr. Andreas Greulich
Swiss Federal Office of Information Technology and Systems
Monbijoustr. 74 - CH-3003 Bern - Switzerland
Phone: ++41 31 325 80 86
Fax: ++41 31 325 90 30, ATTN. A.Greulich
Internet: andreas.greulich@bfi.admin.ch
HTTP: http://www.imsv.unibe.ch/~greulich
*********************************************************************
------------------------------
Date: 2 Mar 1998 08:42:05 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: XEmacs Perl mode w prototypes?
Message-Id: <6ddrct$t11$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Andreas Greulich
<andreas.greulich@mbox.bfi.admin.ch>],
who wrote in article <34FA61D4.6CB92359@mbox.bfi.admin.ch>:
> Hi all,
>
> I'm using Perl 5.004 and XEmacs 20.3 with CPerl mode. It works fine and
> mainly I like it... the only problem I have is that the perl mode does
> not recognize deveral syntax features. The most annoying thing is that
> after every line of the form "sub xxx($);" (ie, after each prototype),
You need to upgrade to RMS Emacs. There are some bugs 20.2, but now
there are patches for all of them.
> it automatically indents. I have automatical indentiung turned on
> because I like the feature. Is there a way, or a version ofd perl mode,
> that knows about proitotypes? Also, with the auto-lf mode, it
> automatically linefeeds after typing the } sign in "$x{aa}" when I plan
> to write "$x{a}=4;".
I do not think many people have a chance to see it, since nobody types
`}' nowadays, but thanks for a bug report. Fixed in my copy.
Ilya
------------------------------
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 2000
**************************************