[7692] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1318 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 14 12:16:23 1997

Date: Fri, 14 Nov 97 09:00:23 -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           Fri, 14 Nov 1997     Volume: 8 Number: 1318

Today's topics:
     Re: ./[script.pl] not working <mark@pla.to>
     Re: Block comments in Perl? (Frank Hoehne)
     Re: Block comments in Perl? (Tad McClellan)
     Re: Block comments in Perl? (Malcolm Beattie)
     Re: carriage returns <robert.friberg@eductus-vast.com>
     h2xs and c code <mreed@cis.ohio-state.edu>
     Help...Help, install failed, please help!! (Ruogang Zhu)
     http password help! PLEASE!... ELABORATED (Me)
     Re: IO::Select different in 5.004_4 <-> 5.004_3? <gbarr@ti.com>
     is h2xs supposed to do this? (Des Herriott)
     Need Perl consultant - Northern NJ -- short or medium t perljob@fame.com
     ora_open <marcop@unipg.it>
     oraperl <marcop@unipg.it>
     Re: PERL interpreter in Java? (Douglas E. Schwartz)
     PERL Programmer Needed NOW! marcus@alex.net
     Ping and MacPerl Problems <dt6@doc.ic.ac.uk>
     return codes (Kitty Smith)
     Re: return codes (Mike Stok)
     Re: Standard PERL dist under Win95? <dtbaker@flash.net>
     Re: which Perl is for me?! can't find 5.004_04 for win9 <dtbaker@flash.net>
     write daemon with Perl <WCHEONG@nortel.ca>
     Re: Year2000 problem with localtime(); <chenym@dufu.math.ncu.edu.tw>
     Re: Year2000 problem with localtime(); (I R A Aggie)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 14 Nov 1997 16:02:13 GMT
From: <mark@pla.to>
Subject: Re: ./[script.pl] not working
Message-Id: <01bcf116$3115d460$064300c3@archive>


Radix <tristram@freemail.c3.hu> wrote in article
<346AABB2.25C0@freemail.c3.hu>...
> Hello ppl,
> 
> I would like to have our web server run perl scripts using cgi on a
> machine with sun solaris 2.6. Still, the script doesnt seem to work. Its
> is placed in the cgi-bin dir. There are sample scripts coming with the
> web server software [sun ws], however, they are not perl scripts,
> instead something like this:
> #!/usr/bin
> echo "hello world"
> 
> They can be run from the shell with ./[script].
> 
> I have perl installed on the machine, so in the shell i can do:
> perl [script.pl]
> It runs the script. Still, i cant run it from ./[script.pl]. As I
> understand it would be needed to implement perl scripts on the web
> server.
Did you use chmod to make it executable?
Did you put in "#!/usr/bin/perl" as a first line? (or wherever the perl prg
is?)

[root@mind cgi-bin]# ls t -l
-rw-rw-r--   1 root     root           38 Nov 14 19:29 t

[root@mind cgi-bin]# cat t
#! /usr/bin/perl
print "This works!\n";

[root@mind cgi-bin]# ./t
bash: ./t: Permission denied

[root@mind cgi-bin]# chmod 755 t

[root@mind cgi-bin]# ./t
This works!
[root@mind cgi-bin]#



Clear?
        

> Any help appreciated, thanks.
> 
> Radix
> 


-- 
mark@pla.to   http://mind.pla.to - de site voor tweede hands computers en
computer-onderdelen



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

Date: Fri, 14 Nov 1997 13:00:14 GMT
From: frank.hoehne@hamburg.netsurf.de (Frank Hoehne)
Subject: Re: Block comments in Perl?
Message-Id: <346c1b7c.1335138@news.hamburg.netsurf.de>

>>>This is dumb but how do I do block comments in Perl (5.003)?  perlsyn says C 
>>>style /* */ block comment is out, so how?
>
>>The use of the "here-doc" syntax 
>>will let you do /* */-block-comments.
>
>sorry, but your answer has been added to the WRONG pile.
why?
>in your "solution", perl will create a new variable name and will grab
>a chunk of memory for it.
realy: And could you also name that variable:
 ...
<<'*';
This commnents will not
go into POD's
*
 ...
Since here is no assignment to a variable, so why 
should any  memory allocation for the here-doc happen.
>
>since perl has built in block commenting features, ugly pseudo-solutions
>can be left at home.
>
your solution of using the pod-feature for commenting
things out seems ok if you realy want to see all the stuff
in your POD's.  But this is definetly not always the case.
This would made the POD's very ugly - using your nice wording.

Frank Hoehne


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

Date: Fri, 14 Nov 1997 07:17:51 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Block comments in Perl?
Message-Id: <v1jh46.mn.ln@localhost>

Frank Hoehne (frank.hoehne@hamburg.netsurf.de) wrote:
: >>>This is dumb but how do I do block comments in Perl (5.003)?  perlsyn says C 

: >>The use of the "here-doc" syntax 
: >>will let you do /* */-block-comments.
: >
: >sorry, but your answer has been added to the WRONG pile.

: >in your "solution", perl will create a new variable name and will grab
: >a chunk of memory for it.
: realy: And could you also name that variable:
: ....
: <<'*';
: This commnents will not
: go into POD's
: *
: ....
: Since here is no assignment to a variable, so why 
: should any  memory allocation for the here-doc happen.


use -w with your method, see what it says.

It is indeed using memory. Constants go into memory as well as variables.



--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: 14 Nov 1997 15:30:24 GMT
From: mbeattie@sable.ox.ac.uk (Malcolm Beattie)
Subject: Re: Block comments in Perl?
Message-Id: <64hqqg$fu6$1@news.ox.ac.uk>

In article <346c1b7c.1335138@news.hamburg.netsurf.de>,
Frank Hoehne <frank.hoehne@hamburg.netsurf.de> wrote:
>>>>This is dumb but how do I do block comments in Perl (5.003)?  perlsyn says C 
>>>>style /* */ block comment is out, so how?
>>
>>>The use of the "here-doc" syntax 
>>>will let you do /* */-block-comments.
>>
>>sorry, but your answer has been added to the WRONG pile.
>why?
>>in your "solution", perl will create a new variable name and will grab
>>a chunk of memory for it.
>realy: And could you also name that variable:
>...
><<'*';
>This commnents will not
>go into POD's
>*
>...
>Since here is no assignment to a variable, so why 
>should any  memory allocation for the here-doc happen.
>>
>>since perl has built in block commenting features, ugly pseudo-solutions
>>can be left at home.
>>
>your solution of using the pod-feature for commenting
>things out seems ok if you realy want to see all the stuff
>in your POD's.  But this is definetly not always the case.
>This would made the POD's very ugly - using your nice wording.

print "Hello world\n";

=for nobody

This isn't seen by anybody

=cut

print "more stuff here\n";

--Malcolm

-- 
Malcolm Beattie <mbeattie@sable.ox.ac.uk>
Oxford University Computing Services
"I permitted that as a demonstration of futility" --Grey Roger


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

Date: 14 Nov 1997 16:43:14 GMT
From: "Robert Friberg" <robert.friberg@eductus-vast.com>
Subject: Re: carriage returns
Message-Id: <01bcf113$a75b9180$c82da8c0@akilles.ittek.org>



Mark Chaffee <chaffee@cpdmfg.cig.mot.com> skrev i inldgg
<3469E823.67CA@cpdmfg.cig.mot.com>...
> I have a variable that contains a text string with carriage returns.  Is
> there a way to strip them out?
> 
> $var = "This is^Ma text string^Mwith unwanted^Mcarriage returns."

	$var =~ s/\n//g;

-- 
-robban

#######################################
#
#   Robert Friberg	
#   robert.friberg@eductus-vast.com
#
#######################################



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

Date: Fri, 14 Nov 1997 08:15:18 -0500
From: Michael Reed <mreed@cis.ohio-state.edu>
Subject: h2xs and c code
Message-Id: <346C4EE6.58A5@cis.ohio-state.edu>

Hello,

I am trying to employ the first example at:
http://www.aisd.com/technology/perl/man/perlxstut.shtml#perlxstut_name_0

to learn how to call c code from perl.  I am wondering if anyone can
help me with the
following error?  I am on hp-ux 9.05 and using perl 5.003.  I would aslo
appreciate
any info abut other documentation on this.

Here is the flow of my progress:
% perl5 Makefile.PL
Checking if your kit is complete...
Looks good
Writing Makefile for Test1

/export/2/webdocs/j/2/perl/temp/Test1                                          
% make
        /usr/contrib/bin/perl5.003
-I/usr/contrib/lib/perl5/PA-RISC1.1/5.003 -I/usr/contrib/lib/perl5
/usr/contrib/lib/perl5/ExtUtils/xsubpp  -typemap
/usr/contrib/lib/perl5/ExtUtils/typemap Test1.xs >Test1.tc && mv
Test1.tc Test1.c
Please specify prototyping behavior for Test1.xs (see perlxs manual)
        cc -c  -D_HPUX_SOURCE -Aa -I/usr/local/include
-I/usr/contrib/include -O     -DVERSION=\"0.01\"  -DXS_VERSION=\"0.01\"
+z -I/usr/contrib/lib/perl5/PA-RISC1.1/5.003/CORE  Test1.c
Running Mkbootstrap for Test1 ()
        chmod 644 Test1.bs
        LD_RUN_PATH="" ld -o ./blib/arch/auto/Test1/Test1.sl -b
Test1.o     
        chmod 755 ./blib/arch/auto/Test1/Test1.sl
        cp Test1.bs ./blib/arch/auto/Test1/Test1.bs
        chmod 644 ./blib/arch/auto/Test1/Test1.bs
Manifying ./blib/man3/Test1.3

/export/2/webdocs/j/2/perl/temp/Test1                                           
% perl5 test1.pl
Can't find loadable object for module Test1 in @INC (./blib
/usr/contrib/lib/perl5/PA-RISC1.1/5.003 /usr/contrib/lib/perl5
/usr/contrib/lib/perl5/site_perl/PA-RISC1.1
/usr/contrib/lib/perl5/site_perl .) at Test1.pm line 18
BEGIN failed--compilation aborted at test1.pl line 5.

Thanks in advance,
Mike
-- 
Michael Reed
CIS Web Manager                    778 Dreese
Computer and Information Science   2015 Neil Avenue   Col, OH 43012 
The Ohio State University          Office phone:      (614) 292-1153


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

Date: 14 Nov 1997 16:13:59 GMT
From: rgzhu@cb.att.com (Ruogang Zhu)
Subject: Help...Help, install failed, please help!!
Message-Id: <64htc7$e6m@nntpb.cb.lucent.com>

Hi, experts,

I have problem while I tried to install perl 5.004 in sun solaris 2.3.

It failed with following message:
 ...
 ...
 ...
Finding dependencies for util.o.
 ./makedepend: shlist: not found
Searching for .SH files...
Updating makefile...
test -s perlmain.c && touch perlmain.c
*** Error code 1 (ignored)
cd x2p;  depend
sh: depend: not found
*** Error code 1
make: Fatal error: Command failed for target `depend'

please help me!!

thanks in advance

Roger



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

Date: Fri, 14 Nov 1997 16:35:43 GMT
From: Me@home.sleeping (Me)
Subject: http password help! PLEASE!... ELABORATED
Message-Id: <64huhu$827$1@goblin.uunet.ca>

O.K., Kaybe I didn't prase myself too well. I try to elaborate more clearly.

I'm currently trying to figure out how to generate the encoded passwords in 
the .htpasswd file, in a perl script. 

Just in case you dan't know what I'm talking about:

assuming I want to put a login and password protected page in my website, I 
must first place a .htaccess file in themain directory that I want to protect, 
simillar to the following:

AuthName The Official Backstreet Boys New Website
AuthType Basic
AuthUserFile /www/htdocs/admin/.htpasswd

<Limit GET>
require user machoman
</Limit>

In order to establish the password for the user machoman, I must telnet into 
the virtual server, change directories until I get to the /www/htdocs/admin/ 
directory and execute the following command:

htpasswd -c .htpasswd machoman

the server thus responds with the following

password:

of which I type 

village

it then asks for a confirmation with the following:

re-type password:

of which again I type:

village

in the file /www/htdocs/admin/.htpasswd the following is contained:

machoman:lmKBvAuvduC1Q

of which lmKBvAuvduC1Q is the encoded version if village, which is generated 
by the server itself. My question is thus this: how do I reproduce the proper 
coding sequence in cgi-perl to generate new encoded passwords that the server 
will understand. I know that it involves utilizing the crypt command which 
takes on the following format:

$encoded_variable = crypt ($variable_to_be_encoded,$salt);

It is the $salt variable that controls how the server encodes the 
$variable_to_be_encoded, to end up with the final $encoded_variable. But I 
cannot for the life of me figure out exactly how the server salts the 
$variable_to_be_encoded.

Thus I ask the following:

How do I generate a $salt sequence that will perfectly reproduce an 
appropriately $encoded_variable? 

I've tried the following, to seek thew proper salt sequence, but the server 
continues to run out of memory:

 $login = "machoman";
 $encrypted1 = "lmKBvAuvduC1Q";
 $attemp = "village";                  

$cleared = "no";
while ($cleared eq "no") {
  srand (time ^ ($$ + ($$ << 15)));
  @alphabet = ('a' .. 'z', 'A' .. 'Z', '0' .. '9', '.', '/');
  $number_one = $alphabet[rand(@alphabet)];
  $number_two = $alphabet[rand(@alphabet)];
  $salt = $number_one.$number_two;
  $encrypted = crypt($attemp,$salt);
  if ($encrypted eq $encrypted1) {
        $cleared = "yes";
  }
}

Is there a perl module that does this already? 
Any help would be greatly appreciated.


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

Date: Fri, 14 Nov 1997 08:13:38 -0600
From: Graham Barr <gbarr@ti.com>
To: Michel van der List <vanderlistmj@ANTISPAMremoveme.sbphrd.com>
Subject: Re: IO::Select different in 5.004_4 <-> 5.004_3?
Message-Id: <346C5C92.6E2DE2C0@ti.com>

Michel van der List wrote:
> 
> Hi.
> 
> I was playing around with perl somewhat (for my own edification)
> and ran into the following problem. I have a 5.004_04
> installation on a dec unix machine and a 5.004_03 on another. I
> wrote a little piece of code, using some publically available
> packages, which works fine on the 5.004_03 installation, but
> not at all on the 5.004_04 installation. The difference is that
> the IO::Select->select call does not seem to return when I type
> something in.

Your problem is more than likely the difference between the two machines
nor the two versions of perl/IO::Select

> I am somewhat confused over this.
> 
> My questions are:
> 
> - Should this code work (it works at least in some cases...)?

nearly

> - If not, why not?

readon

> - If yes, why doesn't it work on 5.004_04?

Have you tried it with perl5.004_04 on any other machine ? If not
try not to jump to conclusions

> I did not install the 5.004_03 version, but the 5.004_04
> version is a vanilla perl install, taking all the defaults for
> dec_osf.
> 
>  a d v
> Thanks a
>  e c n         Michel
> 
> #!/usr/local/bin/perl
> 
> use strict;
> 
> package testIO;
> 
> use IO::Select;
> use Net::Telnet;
> use Term::ReadKey;
> 
> my ($serversock,
>    $readable_handles,
>    $new_readable,
>    $readable,
>    $buf);
> 
> select(STDIN); $| = 1;
> 
> ReadMode 3;
> 
> $readable_handles = new IO::Select();
> $serversock = new Net::Telnet (Host => 'curley');
> die "Socket could not be created. Reason: $!\n" unless $serversock;
> $serversock->output_record_separator('');
> 
> $readable_handles->add($serversock);
> $readable_handles->add(*STDIN);

IO::select is not designed to take GLOB's the above line should be

 $readable_handles->add(\*STDIN);

this alone may fix your problem.

> 
> while ( 1 ) {
>     ($new_readable) = IO::Select->select($readable_handles, undef, undef, 0);

two things here.

first if all you want to do is check for readable handles then all you
need is

   $new_readable  = $readable_handles->can_read(0);

secondly I think you will find on machines where this does work
that your CPU usage might be a little high.

Let's consider what you are trying to do. It seems to me that you want
to wait for some data, process it and then wait again. So why call select
with a 0 timeout, that will cause it to return whether ot not
there is anything ready, but if nothing is ready you do nothing,
loop and call select again.

The idea of the timeout is to reduce this CPU overhead. Adding
a timeout will not cause it to not return until that time, select
will return immediatley that something is ready, it will
only return with nothing after the given timeout has passed.

<snip>

Graham.

-- 
Originality is the ability to conceal your source.


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

Date: 14 Nov 1997 15:48:28 GMT
From: des@corp.netcom.net.uk (Des Herriott)
Subject: is h2xs supposed to do this?
Message-Id: <64hrsc$m0g$1@taliesin.netcom.net.uk>

Hi,

I'm having with a play with writing some XS code, so I've started
with a trivial one-function test library - here's the header:

  int do_foo(int x, int y);

I generate the Perl module like this:

  $ h2xs -x -n Foo /path/to/foo.h -L/path/to/lib -lfoo
  
This creates the .xs file OK, but it contains this declaration for do_foo:

  int
  do_foo(arg0, arg1)
        int x   arg0
        int y   arg1

This doesn't look right, and it doesn't compile either.  Have I missed
something here?

I'm using perl-5.004_04 with C::Scan-0.4, and this happens on both
Solaris 2.6 and RH Linux 4.2.

Thanks,

-- 
Des Herriott
des@corp.netcom.net.uk


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

Date: Fri, 14 Nov 1997 13:03:34 GMT
From: perljob@fame.com
Subject: Need Perl consultant - Northern NJ -- short or medium term
Message-Id: <346d4938.499338@nntp.ix.netcom.com>

We need an experienced Perl programmer to complete a job that has
already been started. Duration is open as are longer term assignments
for talented programmers.

The New Jersey office of FAME is located in Livingston, NJ on
Eisenhower Parkway.  While some of the work could be done off-site, we
will require the programmer to spend some time at our facility for
design discussions and testing.

The need is immediate.  Individuals and agencies are welcome to
submit.

Please send qualifications, rate and availability to:
perljob@fame.com.


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

Date: Fri, 14 Nov 1997 17:08:12 +0100
From: Pallotta Marco <marcop@unipg.it>
Subject: ora_open
Message-Id: <346C776C.167E@unipg.it>

Hi.

Why the oracle command "desc TABLE_NAME" inserted in the oraperl command
ora_open doesn't work??????

Which oraperl command I must use to do this (executing the "describe",
or "desc", coomand) ????

Thanks.



                                 \|||/
                                 (o o)
            _________________oOOo_(_)_oOOo__________________
 __________|               ******************               |__________
 \         |               * Marco Pallotta *               |         / 
  \        |               ******************               |        /
   \       |                                                |       / 
    \      |         1st e-mail: marcop@unipg.it            |      /
     \     |         2nd e-mail: marcop@rp.unipg.it         |     /
     /     |                                                |     \
    /      |           http://www.unipg.it/~marcop          |      \ 
   /       | http://cronos.rp.unipg.it/~marcop/welcome.html |       \
  /        |________________________________________________|        \
 /____________)                 |__|__|                 (_____________\
                                 || ||
                                ooO Ooo


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

Date: Fri, 14 Nov 1997 16:13:55 +0100
From: Pallotta Marco <marcop@unipg.it>
Subject: oraperl
Message-Id: <346C6AB3.41C6@unipg.it>

Hi to everybody!!!!

I have a great problem with my pearl CGI and Oracle database.
That is, I want to do this oracle command in my CGI: desc NOME_TABELLAx, 
This shows the structure of the desired table. 
The problem is that in my CGI this command doesn't work; I use the
oraperl command "ora_open" like when I want to do a simple query, but
probably it's wrong.

Is there someone can help me????

Thank you


Marco Pallotta - Perugia (PG) - Italy.

                                 \|||/
                                 (o o)
            _________________oOOo_(_)_oOOo__________________
 __________|               ******************               |__________
 \         |               * Marco Pallotta *               |         / 
  \        |               ******************               |        /
   \       |                                                |       / 
    \      |         1st e-mail: marcop@unipg.it            |      /
     \     |         2nd e-mail: marcop@rp.unipg.it         |     /
     /     |                                                |     \
    /      |           http://www.unipg.it/~marcop          |      \ 
   /       | http://cronos.rp.unipg.it/~marcop/welcome.html |       \
  /        |________________________________________________|        \
 /____________)                 |__|__|                 (_____________\
                                 || ||
                                ooO Ooo


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

Date: 14 Nov 1997 07:15:36 -0800
From: dougs@halcyon.com (Douglas E. Schwartz)
Subject: Re: PERL interpreter in Java?
Message-Id: <64hpuo$ocd$1@halcyon.com>

In article <647a33$ddn$2@nntp2.ba.best.com>, Zenin  <zenin@best.com> wrote:
>Jim Voll <jjv@netapp-nospam.com> wrote:
>: This may seem silly, but does anyone know of a PERL interpreter
>: written in Java?
>
>	No, but there is a Perl regexp engine in Java, somewere.  Check
>	out the search engines.

I think Oreilly (the book people) have one. From something I snarfed
about a week ago:

"For the case or regular expression matching, I've heard good
things about OROMatcher but haven't used it myself.  It's
compatible with Perl _5_ pattern matching and is free for
both commercial and non-commercial use.  Read all about it at
http://www.oroinc.com/downloads/index.html#OROMatcher"


doug


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

Date: Fri, 14 Nov 1997 10:32:59 -0600
From: marcus@alex.net
Subject: PERL Programmer Needed NOW!
Message-Id: <879523791.3932@dejanews.com>

We have a number of projects that require a good PERL programmer NOW!
Please call 1-888-253-9637 and ask for Marcus Davis.

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Fri, 14 Nov 1997 08:32:31 -0600
From: "Dale Thatcher" <dt6@doc.ic.ac.uk>
Subject: Ping and MacPerl Problems
Message-Id: <879517104.29111@dejanews.com>

Hi,

I have been confused by some results had when tring to 'ping' other
machines from MacPerl using Net::Ping.

We have a small network with five PC's and one Mac.  I've been tring to
'ping' the PC's from the Mac using MacPerl.  One of the PC's is a
dedicated NT webserver which I have no problem pinging.  I also have no
problem 'pinging' the Mac.  But I get no joy at all from the other
machines.  As far as I am aware the other machines are running standard
NT4.0 and they have no trouble doing a command line ping between them.

Any ideas?

Thanks,

- Dale

--
I tawt I taw a puddy tat.
                          So, Mr. Tweety, you are not sure of the facts?
      |\      _,,,---,,_
ZZZzz /,`.-'`'    -.  ;-;;,_                Dale Thatcher
     |,4-  ) )-,_. ,\ (  `'-'        mailto:zogulus@earthling.net
    '---''(_/--'  `-'\_) http://www.geocities.com/ResearchTriangle/3272/

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Thu, 13 Nov 1997 16:51:55 -0600
From: smith@twsuvm.uc.twsu.edu (Kitty Smith)
Subject: return codes
Message-Id: <19971113.165155.376829.NETNEWS@TWSUVM.UC.TWSU.EDU>

Where can I get a list of return codes for perl.

I am issuing a system function call and get a rc of 256.  I don't know
what that means.

Any help is much appreciated.




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

Date: 14 Nov 1997 15:37:53 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: return codes
Message-Id: <64hr8h$a52@news-central.tiac.net>

In article <19971113.165155.376829.NETNEWS@TWSUVM.UC.TWSU.EDU>,
Kitty Smith <smith@twsuvm.uc.twsu.edu> wrote:
>Where can I get a list of return codes for perl.
>
>I am issuing a system function call and get a rc of 256.  I don't know
>what that means.

(assuming unix or something similar...)

It means the thing you called exited with a status of 1.  The perlfunc man
page says this:

       system LIST
               Does exactly the same thing as "exec LIST" except
               that a fork is done first, and the parent process
               waits for the child process to complete.  Note
               that argument processing varies depending on the
               number of arguments.  The return value is the exit
               status of the program as returned by the wait()
               call.  To get the actual exit value divide by 256.
               See also the exec entry elsewhere in this document

               [...]


               Here's a more elaborate example of analysing the
               return value from system() on a Unix system to
               check for all possibilities, including for signals
               and core dumps.

                   $rc = 0xffff & system @args;
                   printf "system(%s) returned %#04x: ", "@args", $rc;
                   if ($rc == 0) {
                       print "ran with normal exit\n";
                   }
                   elsif ($rc == 0xff00) {
                       print "command failed: $!\n";
                   }
                   elsif ($rc > 0x80) {
                       $rc >>= 8;
                       print "ran with non-zero exit status $rc\n";
                   }
                   else {
                       print "ran with ";
                       if ($rc &   0x80) {
                           $rc &= ~0x80;
                           print "core dump from ";
                       }
                       print "signal $rc\n"
                   }
                   $ok = ($rc != 0);

If you want to know more then the C library function wait or waitpid
should be a reasonable place to start.

Hope this helps,

Mike


-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: Fri, 14 Nov 1997 07:24:10 -0700
From: Dan Baker <dtbaker@flash.net>
Subject: Re: Standard PERL dist under Win95?
Message-Id: <346C5F0A.27C@flash.net>

sysadmin wrote:
> 
> I, too, have wondered about this.  While I am currently happy running the
>  MKS 5.004.03 version of PERL on Win95
---------
Have you found the 5004.04 version anywhere? sounds like there were good
bug fixes in it... I don't have any way to compile, so I need to find
the binaries. Please post the full URL if you find them!

Also,if you have any information on how to extract from the tar.gz
files, it would be helpful.... will winzip work on win95, or do I need
something else?



> I do NOT want binaries from ActiveState, etc as the greatest aspect of PERL
>  is its ability to remove my reliance on third-party suppliers.  Give me
>  the source anyday.
---------
I don't mind the binaries... a long as they are free;) But I'd like to
get the latest. Does the build 313 from activestate correspond to
5.004.04, or what?

Dan


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

Date: Fri, 14 Nov 1997 07:19:42 -0700
From: Dan Baker <dtbaker@flash.net>
Subject: Re: which Perl is for me?! can't find 5.004_04 for win95
Message-Id: <346C5DFE.19E2@flash.net>

etta wrote:
> 
> Here's where you can get the latetest version of perl5 build 313 for win95.
> 
> http://www.activestate.com/

-----------------
thanx.... but I thought that the stuff from
http://www.perl.com/CPAN-local/ports/win95/Gurusamy_Sarathy/ was
supposed to be "better?". sounded like earlier builds had some memory
bugs, etc. I just don't see the 04 version in there... unless I'm not
looking in the right place?

Dan


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

Date: Fri, 14 Nov 1997 10:28:27 -0500
From: Wallace Cheong <WCHEONG@nortel.ca>
Subject: write daemon with Perl
Message-Id: <346C6E1B.3331@nortel.ca>

I am trying to write a daemon program in Perl.  I did a fork and exec
command in the perl script.  I would like to set the child process
session id to its process id, so that it becomes the session and group
leader and detach from any controlling terminal.  I couldn't find the
equalivant command of setsid in Perl functions.  How can I do that?  
All I want is that the Perl script running in the background will not
hangup after I exit from the shell.   I don't want to call the perl
script through nohup command.  How to do that?

-- 
Wallace Cheong
Nortel, Bramalea, Canada
905-863-2466


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

Date: 14 Nov 1997 13:49:52 GMT
From: "Mr. Yen-Ming Chen" <chenym@dufu.math.ncu.edu.tw>
Subject: Re: Year2000 problem with localtime();
Message-Id: <64hku0$mmi$1@news.ncu.edu.tw>

Fabrice Scemama <scemama@doubt.com> 4#(l:
: At least, give localtime a try with a >=2000 year.
: You'll see that localtime will handle it properly.
: If 1997 is written as 97, well, 2017 is
: written as 117. Example: 01/01/2017 -> 01/01/117 .
: No big deal, you still have to add 1900.

 In a DEC Alpha, the localtime can present up to year 2038, Jan. 19th,
11:14:07. So that means it(Unix) will have a "year 2038" problem?? :)

-- 
We work in the dark, We do what we can, We give what we have, 
Our doubt is our passion, and our passion is our task, 
The rest is the madness of art.  	Yen-Ming (Miles) Chen. 
chenym@ms1.hinet.net || http://www.math.ncu.edu.tw/~chenym/


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

Date: Fri, 14 Nov 1997 10:35:41 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Year2000 problem with localtime();
Message-Id: <-1411971035410001@aggie.coaps.fsu.edu>

In article <64hku0$mmi$1@news.ncu.edu.tw>, "Mr. Yen-Ming Chen"
<chenym@dufu.math.ncu.edu.tw> wrote:

+  In a DEC Alpha, the localtime can present up to year 2038, Jan. 19th,
+ 11:14:07. So that means it(Unix) will have a "year 2038" problem?? :)

Yes. I doubt we'll have to worry about it, in theory we should all be
usingin 64 bit (or better) libraries. 

I won't be worrying about the 2^63 year problem... :)

James

-- 
Consulting Minister for Consultants, DNRC
Support the anti-Spam amendment <url:http://www.cauce.org/>
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>


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

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

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