[17394] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4815 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Nov 5 18:05:33 2000

Date: Sun, 5 Nov 2000 15:05:12 -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: <973465511-v9-i4815@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 5 Nov 2000     Volume: 9 Number: 4815

Today's topics:
    Re: ANN-Upload.it, for sharewarists (and a request) <camerond@mail.uca.edu>
    Re: Array of Hash <pavel@gingerall.cz>
        atoi for Perl <ddijk@hetnet.nl>
    Re: atoi for Perl <kevin@vailstar.com>
        beginner need some help metamp@my-deja.com
    Re: Building a Module on Server without Install.pm <nospam@david-steuber.com>
        Clearing the screen <jbou@bunker79.fsnet.co.uk>
        Clearing the screen <jbou@bunker79.fsnet.co.uk>
    Re: Clearing the screen <adamf@box43.gnet.pl>
    Re: Clearing the screen (Tarael200)
    Re: even or odd ? <nospam@david-steuber.com>
    Re: File locking <g.soper@soundhouse.co.uk>
    Re: File locking <mikecook@cigarpool.com>
    Re: Freelance Programmer Neede - Good Money <nospam@david-steuber.com>
    Re: Freelance Programmer Neede - Good Money (Tad McClellan)
        getopt doesn't seem work as expected <bwlang@usa.net>
    Re: Hardwood Website <MIREBEAU.FAMILY@wanadoo.fr>
        Help with Building GD.pm on Linux <usenet@hank.org>
        how to create EXCEL CHARTS from Perl!!!! <biggerbrother@videotron.ca>
        how to get return value of process <jprokopek@snet.net>
    Re: how to get return value of process <ren.maddox@tivoli.com>
    Re: how to get return value of process <aqumsieh@hyperchip.com>
    Re: how to make $ARGV[0] numeric <krahnj@acm.org>
    Re: Is there a way to get all PID's within Perl ? (Abigail)
    Re: Is there a way to get all PID's within Perl ? (Martien Verbruggen)
    Re: Javadoc for Perl? <bwlang@usa.net>
        Looking for idiom for getting value from @ARGV, or a de <mra@pobox.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 05 Nov 2000 13:43:00 -0600
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: ANN-Upload.it, for sharewarists (and a request)
Message-Id: <3A05B844.C203BA4@mail.uca.edu>

Jonathan Stowe wrote:
> 
> On Thu, 02 Nov 2000 11:58:23 +0100 Dr.Upload wrote:
> > Hi!
> > http://xxxxxx.it is a new site created for
> > sharewarists, i.e. shareware developers.
> >
> 
> Hands up if there are any 'sharewarists' on the group ....

I grew up a Methodist, is that close enough? (but now I'm an ...'ian')

Cameron

-- 
Cameron Dorey
Associate Professor of Chemistry
University of Central Arkansas
Phone: 501-450-5938
camerond@mail.uca.edu


------------------------------

Date: Sun, 05 Nov 2000 18:27:47 +0100
From: Pavel Hlavnicka <pavel@gingerall.cz>
Subject: Re: Array of Hash
Message-Id: <3A059893.6010504@gingerall.cz>

You need hack appropriate .xs file. There are two ways, how to convert 
values from native call to perl value.

1. You may add pack/unpack code into the typemap file
2. You may say, that function returns SV* value and write call into xs 
function.

See perlxs and perlguts manpages. Feel free to ask more specific 
questions (and it cc to my private address)


Joe Giuffrida wrote:

> I am trying to write an extension interfacing to a C library and one of the
> functions returns and array of pointers to a struct and I want to return it
> as an array of hash and I have no idea how to do this.  Could someone help
> me get started ?
> 
> -Joe


-- 
Pavel Hlavnicka
Ginger Alliance Ltd.
Prague; Czech Republic



------------------------------

Date: Sun, 5 Nov 2000 19:33:04 +0100
From: "dick dijk" <ddijk@hetnet.nl>
Subject: atoi for Perl
Message-Id: <uyV5Yd1RAHA.282@net003s>

Hello,

Does anyone know the "atoi()" function (from C) equivalent in Perl?

Dick




------------------------------

Date: Sun, 05 Nov 2000 14:37:17 -0500
From: Kevin Michael Vail <kevin@vailstar.com>
Subject: Re: atoi for Perl
Message-Id: <kevin-09067A.14371705112000@news.his.com>

In article <uyV5Yd1RAHA.282@net003s>, "dick dijk" <ddijk@hetnet.nl> 
wrote:

> Does anyone know the "atoi()" function (from C) equivalent in Perl?

Perl doesn't need one.  If you want a variable to be a number, do 
arithmetic on it.  If you want it to be a string, do string operations 
on it.  Most of the time it doesn't matter.

    $k = "1";
    $j = 1 + $k;
    $l = 1 . $k;
    print "j = $j, l = $l\n";

prints "j = 2, l = 11"
-- 
Kevin Michael Vail | a billion stars go spinning through the night,
kevin@vailstar.com | blazing high above your head.
 . . . . . . . . .  | But _in_ you is the presence that
 . . . . . . . . . | will be, when all the stars are dead.  (Rainer Maria Rilke)


------------------------------

Date: Sun, 05 Nov 2000 19:15:09 GMT
From: metamp@my-deja.com
Subject: beginner need some help
Message-Id: <8u4bjp$li7$1@nnrp1.deja.com>

how to make the script to sent the file directly insted useing
print "location http://www.site.com/file.zip"

my problem with this is that the print "location...... shows up in url


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Sun, 05 Nov 2000 20:00:20 GMT
From: David Steuber <nospam@david-steuber.com>
Subject: Re: Building a Module on Server without Install.pm
Message-Id: <m3hf5mp4ty.fsf@solo.david-steuber.com>

"Alan J. Flavell" <flavell@mail.cern.ch> writes:

' On Sun, 5 Nov 2000, Martien Verbruggen wrote:
' 
' > On Sun, 05 Nov 2000 00:44:26 GMT,
' > 	MNJP <not.my.real.email@bellglobal.com> wrote:
' > 
' > [rewrapped and reformatted article to make it a bit more readable]
' 
' You know, Martien, in the course of the past 24 hours I found myself
' three times starting to compose a response to three different pieces
' of nonsense from this MNJP, and then abandoning it because it didn't
' seem worth the bother - because there simply was no "class" in the
' postings, and I decided to rely on the well-recognised upside-down
' quotage as sufficient warning to anyone who might get misled.

I also support Marien in this case.  CGI.pm is a well established
module with much useful functionality that I would not care to
re-invent just for the hell of it.  I'm not saying I would use it to
generate HTML, but I sure as heck would use it for the actaul CGI 1.1
spec protocol stuff and getting submited form/querystring variables if
I was doing a CGI instead of a mod_perl or Apache::ASP resource.

' > > I guess I do fall under the category "know what you're doing and doing it
' > > correctly" 
' 
' Well we haven't seen any production code, but the garbage that has
' been offered to others shows that didactic skills, at least, are
' lacking...

Not to mention that if you use a standard module such as CGI.pm, you
have a much larger pool of developers available to maintain the code
without having to learn this `other stuff'.

If I were an IT manager, I would want to take advantage of the popular
packages in order to reduce the effort of my developers.  Development
time costs more money than hardware, network bandwidth, etc.  That's
what code reuse is all about.  CGI.pm exemplifies that.

' > > Sine I have developed online banking commerce systems, web
' > > portals, a webmail system from the ground-up, and much more.
' 
' Yeah, I've seen plenty of commercial systems that suck. 

I've worked to improve a few.  It's not easy work.  Fact is, most code
written sucks.  Certainly the first few itterations.  Another argument
for reusing the good stuff.

' "Web portals", indeed.

Isn't that a fancy name for a site that links to other sites?

' I'm afraid that history shows that technologically advanced solutions
' can't win.  The customers understand brute force much better than they
' understand the right answer. 

I think what you are describing here is people who don't RTFM.  My
personal experience is that it is much easier to learn to use a well
designed library (I'm drawing from C++ here, but I'm sure the
principle carries over to Perl) than it is to design and implement a
well designed library.

Borrowing a term from the Camel, I would say that false laziness and
false hubris are at work here when people choose to build another
wheel when a good wheel already exists.

' I'd be interested to see what "pretty clever things" the hackers would
' do with the rest.  You're familiar with CA-2000-02 of course?

I'm not.  Is this something I can find on CERT?  Do you have a URL
handy?  Wait a sec, let me hit Google...

http://www.cert.org/advisories/CA-2000-02.html

Ok, I am familiar with this one.  I just didn't grok `CA-2000-02'.

I've always wondered how someone could design a page like that.  I
think my personal site is clean, but then I haven't really tested it.
Maybe someone can put evil JavaScript code in the right place and have
an infinity of browser windows pop open.  I guess I should check that.

' Martien:
' > You don't know what I do, who I am, or what my qualifications are. 
' 
' I don't either, but your advice speaks for itself, and I'd take it
' any day in preference to the posturing of this anonymous creature.

Well, I don't like to dengrate people, but I agree.  It is easy to
tell when someone is slinging bovine scat vs someone who gives sound
technical advice.

For my own sites, I do have the luxury of installing what ever Perl
modules I feel I need to do the job.  I don't know what the situation
is with most IT organizations.  I would think that having a Systems
Adminstrator install a required Perl module would be a standard
procedure at any decent organization.

-- 
David Steuber | Perl apprentice.  The axe did not stop the
NRA Member    | mops and buckets from flooding my home.
ICQ# 91465842
***         http://www.david-steuber.com/          ***


------------------------------

Date: Sun, 5 Nov 2000 14:12:23 -0000
From: "James Boulter" <jbou@bunker79.fsnet.co.uk>
Subject: Clearing the screen
Message-Id: <8u3pu1$fkc$1@news7.svr.pol.co.uk>

Dear all,

I wondered if it were possible to clear the screen of all on it in DOS

Thanks
James





------------------------------

Date: Sun, 5 Nov 2000 14:55:20 -0000
From: "James Boulter" <jbou@bunker79.fsnet.co.uk>
Subject: Clearing the screen
Message-Id: <8u3sde$ecj$1@news8.svr.pol.co.uk>

Dear all,

Can anyone tell me how to clear the screen in MS-DOS.
From Perl

James





------------------------------

Date: Sun, 05 Nov 2000 21:10:39 +0100
From: Adam <adamf@box43.gnet.pl>
Subject: Re: Clearing the screen
Message-Id: <3A05BEBF.30D@box43.gnet.pl>

James Boulter wrote:
 ...
> Can anyone tell me how to clear the screen in MS-DOS.
> From Perl

for example:
# perl -e "system cls"

BTW it was not a good idea to ask twice the qusetion.
if you will continue doing that, you cannot expect any 
helpful response.

--
Adam.


------------------------------

Date: 05 Nov 2000 21:07:17 GMT
From: tarael200@aol.com (Tarael200)
Subject: Re: Clearing the screen
Message-Id: <20001105160717.18139.00000764@ng-fr1.aol.com>

>
>> Can anyone tell me how to clear the screen in MS-DOS.
>> From Perl
>
>for example:
># perl -e "system cls"
>

Well, that's one way. But there's another way that's more efficient, and far
more portable:

Use ANSI escape sequences!

Currently, I be working on a library of routines to use nearly all ANSI escape
sequences, with the exception of a few that don't particularly work well.

For more information search for NNANSI and ANSI Escape Sequences in Yahoo...
-Ryan



------------------------------

Date: Sun, 05 Nov 2000 19:25:27 GMT
From: David Steuber <nospam@david-steuber.com>
Subject: Re: even or odd ?
Message-Id: <m3lmuyp6fu.fsf@solo.david-steuber.com>

anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) writes:

' >I seem to recall that the tests I've seen were along the lines of this
' >number is probably a prime.
' 
' That would be Miller-Rabin and derivates.  When they say "composite",
' they mean composite.  When they sat "prime", they mean, there is still
' a chance it may not be.  The probability of error can be arbitrary low.

The Java standard classes have such an algorithm.

I'm rather surprised that Math::BigInt doesn't contain a primality
test.  At least the version I have doesn't.  I know such things are
often used for cryptography, but this would seem to be the logical
package to put it in.

The docs do say it is a work in progress.

I wonder why Mark Biggar decided to use base 100000?  I haven't read
the docs on adding Perl extensions yet, so I don't know what the best
way is to hook into an arbitrary machines math libraries is.  It would
be so tempting to use assembler for this sort of thing.  I remember
doing something similar when I needed fixed radix math on a 386
machine.  When you multiply two 32bit values, the result is a 64 bit
value in AXE:DXE (IIRC).  Naturally, I wanted the upper 32 bits, not
the lower 32bits that the C++ compiler (Borland 2.0) gave me.  Yes,
this was Windows, not Linux.

david@solo:> perl -MMath::BigInt -e '$i= new Math::BigInt "123 456 789 110"; print "odd\n" if $i&1;'
david@solo:> perl -MMath::BigInt -e '$i= new Math::BigInt "123 456 789 111"; print "odd\n" if $i&1;'
odd
david@solo:> perl -MMath::BigInt -e '$i= new Math::BigInt "-123 456 789 111"; print "odd\n" if $i&1;'
odd

Well, it looks like & has been overloaded to use the
Math::BigInt->band() method.  Isn't that cool?

-- 
David Steuber | Perl apprentice.  The axe did not stop the
NRA Member    | mops and buckets from flooding my home.
ICQ# 91465842
***         http://www.david-steuber.com/          ***


------------------------------

Date: Sun, 05 Nov 2000 17:07:42 +0000 (GMT)
From: Geoff Soper <g.soper@soundhouse.co.uk>
Subject: Re: File locking
Message-Id: <4a18c72d04g.soper@soundhouse.co.uk>

In article <4a18698264g.soper@soundhouse.co.uk>,
   Geoff Soper <g.soper@soundhouse.co.uk> wrote:
> This is going on information gleaned from the FAQ and perlopentut. I
> don't quite understand the use of 'sysopen' when an exclusive lock is
> required. I understand that it needs to be atomic to avoid the race
> condition between opening and locking but how does using 'sysopen'
> achieve this?

I've been looking at it again and now understand that it's to do with
open() emptying the file immediately and sysopen() leaving it to the
truncate() function.

My next point is do I need to unlock the files or will closing the files
have this effect?

Thanks

-- 
Geoff Soper
g.soper@soundhouse.co.uk
Take a look at the Soundhouse page http://www.soundhouse.co.uk/


------------------------------

Date: Sun, 5 Nov 2000 12:08:33 -0700
From: "Michael Cook" <mikecook@cigarpool.com>
Subject: Re: File locking
Message-Id: <5fiN5.503$R.218274@news.uswest.net>

The close() function will perform the unlock & the close functions...
    Michael
--
== CigarPool ==
http://www.cigarpool.com

"Geoff Soper" <g.soper@soundhouse.co.uk> wrote in message
news:4a18c72d04g.soper@soundhouse.co.uk...
> In article <4a18698264g.soper@soundhouse.co.uk>,
>    Geoff Soper <g.soper@soundhouse.co.uk> wrote:
> > This is going on information gleaned from the FAQ and perlopentut. I
> > don't quite understand the use of 'sysopen' when an exclusive lock is
> > required. I understand that it needs to be atomic to avoid the race
> > condition between opening and locking but how does using 'sysopen'
> > achieve this?
>
> I've been looking at it again and now understand that it's to do with
> open() emptying the file immediately and sysopen() leaving it to the
> truncate() function.
>
> My next point is do I need to unlock the files or will closing the files
> have this effect?
>
> Thanks
>
> --
> Geoff Soper
> g.soper@soundhouse.co.uk
> Take a look at the Soundhouse page http://www.soundhouse.co.uk/




------------------------------

Date: Sun, 05 Nov 2000 20:27:54 GMT
From: David Steuber <nospam@david-steuber.com>
Subject: Re: Freelance Programmer Neede - Good Money
Message-Id: <m3d7gap3jq.fsf@solo.david-steuber.com>

tony@svanstrom.com (Tony L. Svanstrom) writes:

' I'm sorry, I don't hire people with webpages that doesn't pass
' <URL: http://validator.w3.org/ >

Picky, picky, picky.

Fine, I'll fix my pages to conform to HTML 4.01 Transitional.  Or
maybe just 3.2 Final.  I use a little CSS, but not much.

The text for the Google search was generated by Google.  I imagine I
can fix that.   My latest dead tree edition is for 3.2...  I don't
really know how to read a DTD.

It looks to me like I did a bit better than www.microsoft.com ;-).

I guess you won't be hiring any of those guys! :-)

-- 
David Steuber | Perl apprentice.  The axe did not stop the
NRA Member    | mops and buckets from flooding my home.
ICQ# 91465842
***         http://www.david-steuber.com/          ***


------------------------------

Date: Sun, 5 Nov 2000 16:01:52 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Freelance Programmer Neede - Good Money
Message-Id: <slrn90bim0.cgv.tadmc@magna.metronet.com>

On Sun, 05 Nov 2000 20:27:54 GMT, David Steuber 
   <nospam@david-steuber.com> wrote:

>I don't
>really know how to read a DTD.


It is basically just an extended BNF grammar.


-- 
    Tad McClellan                          SGML consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: Sun, 05 Nov 2000 19:22:00 GMT
From: bwlang <bwlang@usa.net>
Subject: getopt doesn't seem work as expected
Message-Id: <3A05B359.D3F722E7@usa.net>

I'm using Getopt:Long

$parsedopts = GetOptions('h' => \$usage,
                        'd=s' => \$blastdb,
                        'q' => \$quiet,
                        'v' => \$verbose);
if ($usage) {$parsedopts = 0}

if (! $parsedopts) {
    showusage();
    exit;
}

When i call this program with no command line parameters $parsedopts
comes
back with a value of "1".  This does not make sense to me since the
required argument "-d blastdbname" is required (as designated by the d=s
bit).
Am I misunderstanding something?

thanks!

brad



------------------------------

Date: Sun, 5 Nov 2000 19:55:31 +0100
From: "MIREBEAU.FAMILY" <MIREBEAU.FAMILY@wanadoo.fr>
Subject: Re: Hardwood Website
Message-Id: <8u4ai8$afp$1@wanadoo.fr>

"Daniel J. Wojcik" <wojcik@genjerdan.com> a écrit dans le message news:
8u3qkl$mk0q$1@ID-34085.news.dfncis.de...
> "Elaine Ashton" <elaine@chaos.wustl.edu> wrote in message
news:4YjM5.13322>
> Actually, I was kinda disappointed it wasn't about Viagra.
>
> Did you know that Sta-Puft Marshmallows have the same effect as Viagra?
>
>
> And did you know that Sta-Puft Viagra have the same effect as Marshmallows
?




------------------------------

Date: Sun, 5 Nov 2000 11:36:47 -0800
From: Bill Moseley <usenet@hank.org>
Subject: Help with Building GD.pm on Linux
Message-Id: <MPG.146f56ad37506165989710@news.newsguy.com>

Attempt number two:

Any ideas why I can't get GD.pm to build?

Running Linux 2.2.13 (SuSE 6.3)

One question is I just built the current version of libgd from Tom's
site (http://www.boutell.com/gd/.)  and it went without a problem.  But 
it installed in /usr/local/*, and my Linux box has libgd, libjpeg, 
libttf installed in /usr/lib and headers in /usr/include.  Could this be 
a problem?

/usr/lib/libgd.a
/usr/lib/libttf.so.2.1.0
/usr/lib/libjpeg.so.6.0.1

I renamed /usr/lib/libgd.a to see if that was a conflict, but didn't 
help with building GD.pm.  

Here's the interesting output from building GD.pm. I get a warning and 
then an error in make test:

AutoSplitting blib/lib/GD.pm (blib/lib/auto/GD)
/usr/bin/perl5.6 -I/usr/local/lib/perl5/5.6.0/i586-linux -
I/usr/local/lib/perl5/5.6.0 /usr/local/lib/perl5/5.6.0/ExtUtils/xsubpp  
-typemap /usr/local/lib/perl5/5.6.0/ExtUtils/typemap -typemap typemap 
GD.xs > GD.xsc && mv GD.xsc GD.c
cc -c -I/usr/local/include -I/usr/local/include/gd -fno-strict-aliasing 
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2     
-DVERSION=\"1.30\" -DXS_VERSION=\"1.30\" -fpic -
I/usr/local/lib/perl5/5.6.0/i586-linux/CORE -DHAVE_JPEG GD.c
GD.xs: In function `XS_GD__Image_newFromXpm':
GD.xs:539: warning: assignment makes pointer from integer without a cast
Running Mkbootstrap for GD ()
chmod 644 GD.bs
LD_RUN_PATH="/usr/local/lib:/usr/lib:/lib" cc -o blib/arch/auto/GD/GD.so  
-shared -L/usr/local/lib GD.o    -L/usr/lib/X11 -L/usr/X11R6/lib -
L/usr/X11/lib -L/usr/local/lib -lgd -lpng -lz -ljpeg -lm 
chmod 755 blib/arch/auto/GD/GD.so
cp GD.bs blib/arch/auto/GD/GD.bs
chmod 644 blib/arch/auto/GD/GD.bs
Manifying blib/man3/GD.3
  /usr/bin/make  -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl5.6 -Iblib/arch -Iblib/lib -
I/usr/local/lib/perl5/5.6.0/i586-linux -I/usr/local/lib/perl5/5.6.0 -e 
'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' 
t/*.t
t/GD................Can't load './blib/arch/auto/GD/GD.so' for module 
GD: ./blib/arch/auto/GD/GD.so: undefined symbol: TT_Open_Face at 
/usr/local/lib/perl5/5.6.0/i586-linux/DynaLoader.pm line 200.
 at t/GD.t line 11

-- 
Bill Moseley


------------------------------

Date: Sun, 05 Nov 2000 14:12:39 -0500
From: Jan Prawdzik <biggerbrother@videotron.ca>
Subject: how to create EXCEL CHARTS from Perl!!!!
Message-Id: <3A05B127.948A1AA9@videotron.ca>

I am trying to create Excel charts using Perl.
My source data is from a text file.
I am able to open an Excel Application, create a new workbook, a new
sheet, and make a chart using my data.
Unfortunately, nothing is taken as the XVALUE for the chart. Since my
first colun of data is TIME, i would like it to be the XVALUE for my
chart.
I know there is an option that does that. I think it's something like
"SERIES->{XVALUE} = $range" or something, but it doesn't quite seem to
work.

Does anyone know how to do this?????

thank you.



------------------------------

Date: Sun, 05 Nov 2000 15:05:45 -0500
From: John D Prokopek <jprokopek@snet.net>
Subject: how to get return value of process
Message-Id: <3A05BD99.AAB0BC41@snet.net>

If I run a process within a perl script how can I get the exit value?

I am doing something like to following to get the output


open STATUS, "./chapname $comp_id  2>&1 |"
				or die "cant fork: $!";
while (<STATUS>)
{
	$logfile = $_;
	print $logfile;
}	

I would like the exit value returned by ./chapname

thanks, I appreciate the help
-- 
John D. Prokopek
jprokopek@snet.net

"The bus came by and I got on
thats when it all began ...."


------------------------------

Date: 05 Nov 2000 14:19:25 -0600
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: how to get return value of process
Message-Id: <m366m2masy.fsf@dhcp11-177.support.tivoli.com>

John D Prokopek <jprokopek@snet.net> writes:

> If I run a process within a perl script how can I get the exit value?
> 
> I am doing something like to following to get the output
> 
> 
> open STATUS, "./chapname $comp_id  2>&1 |"
> 				or die "cant fork: $!";
> while (<STATUS>)
> {
> 	$logfile = $_;
> 	print $logfile;
> }	
> 
> I would like the exit value returned by ./chapname

You need to check $? after closing the filehandle.  See the
description of close in  perlfunc(1) for the details, but basically,
something like:

close STATUS or $! and die "Problem running ./chapname: $!";
my $result = $?;

-- 
Ren Maddox
ren@tivoli.com


------------------------------

Date: Sun, 05 Nov 2000 22:49:16 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: how to get return value of process
Message-Id: <7ahf5mavbk.fsf@merlin.hyperchip.com>


John D Prokopek <jprokopek@snet.net> writes:

> If I run a process within a perl script how can I get the exit value?

	perldoc perlvar

and look for $? ..

--Ala


------------------------------

Date: Sun, 05 Nov 2000 14:21:57 -0800
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: how to make $ARGV[0] numeric
Message-Id: <3A05DD85.E42A9228@acm.org>

dick dijk wrote:
> 
> Hello,
> 
> Does anyone know how to make a commandline argument (like $ARGV[0]) numeric,
> so that you can use it in
> "$a = pack("n", $ARGV[0])"?

It is already numeric, unless of course it's not numeric, if you know
what I mean. ;-)

John


------------------------------

Date: 5 Nov 2000 21:09:38 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Is there a way to get all PID's within Perl ?
Message-Id: <slrn90bj4i.f32.abigail@tsathoggua.rlyeh.net>

On 2 Nov 2000 17:17:50 -0700, Tom Christiansen (tchrist@perl.com) wrote in comp.lang.perl.misc <URL: news:<3a02042e@cs.colorado.edu>>:
++ In article <ydyn1fi2apc.fsf@kulon.arrakisplanet.com>,
++ kevin montuori  <montuori@arrakisplanet.com> wrote:
++ >  tc> Moral of that story: don't use full paths. 
++ >  well, use a full path unless you set $ENV{PATH} yourself.
++ 
++ Well, maybe, in a few rare cases.  If you're using something that's
++ not standard, then *perhaps*.  But otherwise, what's the use of a
++ path then, if you aren't going to allow the user to make their own
++ decisions?
++ 
++ One really cannot predict where things are installed, nor what order
++ the user prefers things in.  If they have /usr/local/nonfree/gnu/bin
++ in their path first, how can you argue with them?  Sure, people can
++ hose themselves.  Hard to make that illegal.


That depends on what you want to do with the program. `ps' is a good
example of why you may want to use a full path instead of relying on the
path setting, because various flavours of `ps' have wildly different
command line options. Where I on Solaris would use `-ef' as command
line options, for a GNU ps I'd use `auxww'. Quite different arguments
(and note the absence of - for GNU ps; for some dark reason, use of a
dash results in a warning).

If I were to write a Solaris tool that uses `ps' to get its information,
I'd use /usr/bin/ps, to not have it break when someone with 
/usr/local/nonfree/gnu/bin before /usr/bin in its path runs the program.

It woudn't be right to demand they modify their PATH before being able
to run the program.



Abigail


------------------------------

Date: Sun, 05 Nov 2000 22:10:25 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Is there a way to get all PID's within Perl ?
Message-Id: <slrn90bmmj.l2.mgjv@verbruggen.comdyn.com.au>

On 5 Nov 2000 21:09:38 GMT,
	Abigail <abigail@foad.org> wrote:
> On 2 Nov 2000 17:17:50 -0700, Tom Christiansen (tchrist@perl.com) wrote in comp.lang.perl.misc <URL: news:<3a02042e@cs.colorado.edu>>:
> ++ In article <ydyn1fi2apc.fsf@kulon.arrakisplanet.com>,
> ++ kevin montuori  <montuori@arrakisplanet.com> wrote:
> ++ >  tc> Moral of that story: don't use full paths. 
> ++ >  well, use a full path unless you set $ENV{PATH} yourself.
> ++ 
> ++ Well, maybe, in a few rare cases.  If you're using something that's
> ++ not standard, then *perhaps*.  But otherwise, what's the use of a
> ++ path then, if you aren't going to allow the user to make their own
> ++ decisions?
> ++ 
> ++ One really cannot predict where things are installed, nor what order
> ++ the user prefers things in.  If they have /usr/local/nonfree/gnu/bin
> ++ in their path first, how can you argue with them?  Sure, people can
> ++ hose themselves.  Hard to make that illegal.
> 
> 
> That depends on what you want to do with the program. `ps' is a good
> example of why you may want to use a full path instead of relying on the
> path setting, because various flavours of `ps' have wildly different
> command line options. Where I on Solaris would use `-ef' as command

On Solaris I'd probably use '/usr/ucb/ps auxww', at least as a first
attempt. On failure I'd probably fall back on /usr/bin/ps.

> line options, for a GNU ps I'd use `auxww'. Quite different arguments
> (and note the absence of - for GNU ps; for some dark reason, use of a
> dash results in a warning).

It's the GNU style of doing things. Make you tool do everything. It
now does so much that it's almost impossible to get it to do the right
thing. They should have just created two binaries, or alternatively
controlled command line switches via a environment variable. Oh well..

I tend to use full paths in some cases, and no path in others. ps is
one that I tend to specify in full.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Think of the average person. Half of
Commercial Dynamics Pty. Ltd.   | the people out there are dumber.
NSW, Australia                  | 


------------------------------

Date: Sun, 05 Nov 2000 19:29:31 GMT
From: bwlang <bwlang@usa.net>
Subject: Re: Javadoc for Perl?
Message-Id: <3A05B51D.4AEECF04@usa.net>

perldoc is somewhat similar

Steve wrote:

> Hi,
>
> I am wondering if there is a program that will generate documentation for
> Perl code like Javadoc does for Java?
>
> - Steve



------------------------------

Date: 05 Nov 2000 14:51:24 -0800
From: Mark Atwood <mra@pobox.com>
Subject: Looking for idiom for getting value from @ARGV, or a default
Message-Id: <m3aebef2xf.fsf@flash.localdomain>


I've seen somewhere a neat little one line expression idiom using
"defined", "shift", and "||" that does something like

$s = shift @ARGV;
unless (defined($s)) {
  $s = 'default';
}

in less space.

But now I can't find an example. Does anyone have any pointers?

-- 
Mark Atwood   | The summit of Mount Everest is marine limestone.
mra@pobox.com | 
http://www.pobox.com/~mra


------------------------------

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 4815
**************************************


home help back first fref pref prev next nref lref last post