[16152] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3564 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 10 16:27:55 2000

Date: Mon, 10 Jul 2000 13:27:43 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <963260863-v9-i3564@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 10 Jul 2000     Volume: 9 Number: 3564

Today's topics:
        Forking Problem scarey_man@my-deja.com
    Re: Forking Problem scarey_man@my-deja.com
        Form Processing in NT <carl.heaton@i-p-hosting.com>
    Re: Form Processing in NT <care227@attglobal.net>
    Re: formatting output of a process <digilio@cig.mot.com>
    Re: formatting output of a process <flavell@mail.cern.ch>
        FTP in Perl5 <wchong@pacific.net.sg>
    Re: FTP in Perl5 <Peter.Dintelmann@dresdner-bank.com>
    Re: FTP in Perl5 (Rasputin)
        GD on HPUX 10.2 stuart_munn@my-deja.com
        Getopt::Long usage question <rob_99@my-deja.com>
    Re: Getopt::Long usage question (Johan Vromans)
        Getting a unique machine ID on win32? <thierry.metoudi@netcourrier.com>
    Re: Getting a unique machine ID on win32? <care227@attglobal.net>
        Getting Files sent via attachment? <raphaelp@nr1webresource.com>
    Re: Getting Files sent via attachment? (Malcolm Dew-Jones)
    Re: Getting Files sent via attachment? <raphaelp@nr1webresource.com>
        Getting Sybase to work on NT 4 nnyglb@my-deja.com
    Re: Getting Sybase to work on NT 4 <adetalabi@clara.co.uk>
    Re: Getting Sybase to work on NT 4 nnyglb@my-deja.com
    Re: Getting the exact address of a file received throug (Abigail)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Mon, 10 Jul 2000 12:41:53 GMT
From: scarey_man@my-deja.com
Subject: Forking Problem
Message-Id: <8kcgae$hl4$1@nnrp1.deja.com>

I have a forking problem.  In the following extract, the array
@stackerlst contains the values 0 and 1.

&Main;

for ($x=0 ; $x < $clid+1 ; $x++) {
        waitpid($child[$x],0);
}

sub Main {
        foreach $item (@stackerlst) {
                if (($child[$clid]=fork()) == 0) {
                        &BackupRoutine($item);
                        $clid++;
                }
        }
}

sub BackupRoutine { $| = 1; ..... }

The program should do the BackupRoutine twice (once with 0, once with
1).  What is actually happening is:
      doing BackRoutine with value 0.
      doing BackRoutine with value 1.
      doing BackRoutine with value 1 again.

Can anyone help?




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


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

Date: Mon, 10 Jul 2000 15:29:44 GMT
From: scarey_man@my-deja.com
Subject: Re: Forking Problem
Message-Id: <8kcq4j$ov2$1@nnrp1.deja.com>

No need to reply.  I have found my problem.
Any additional tips on forking would be appreciated though.

In article <8kcgae$hl4$1@nnrp1.deja.com>,
  scarey_man@my-deja.com wrote:
> I have a forking problem.  In the following extract, the array
> @stackerlst contains the values 0 and 1.
>
> &Main;
>
> for ($x=0 ; $x < $clid+1 ; $x++) {
>         waitpid($child[$x],0);
> }
>
> sub Main {
>         foreach $item (@stackerlst) {
>                 if (($child[$clid]=fork()) == 0) {
>                         &BackupRoutine($item);
>                         $clid++;
>                 }
>         }
> }
>
> sub BackupRoutine { $| = 1; ..... }
>
> The program should do the BackupRoutine twice (once with 0, once with
> 1).  What is actually happening is:
>       doing BackRoutine with value 0.
>       doing BackRoutine with value 1.
>       doing BackRoutine with value 1 again.
>
> Can anyone help?
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>


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


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

Date: Mon, 10 Jul 2000 17:17:37 +0100
From: "i-p-hosting.com @Admin" <carl.heaton@i-p-hosting.com>
Subject: Form Processing in NT
Message-Id: <smjmns2vnu25@corp.supernews.com>

Can anyone help me with form processing in windows NT? all the scripts I try
dont work... Anyone got any links to NT Form mail scripts?
Thanx
Carl






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

Date: Mon, 10 Jul 2000 10:24:02 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Form Processing in NT
Message-Id: <3969DC82.6BC85BCC@attglobal.net>

"i-p-hosting.com @Admin" wrote:
> 
> Can anyone help me with form processing in windows NT? all the scripts I try
> dont work... Anyone got any links to NT Form mail scripts?
> Thanx
> Carl

No one can help you unless you post relevant code.  Not many 
here are willing to write free software for you, or worse...

Use a search engine on your behalf.  

Please post the code that you have been working on (smallest bit
that displays the problem) as well as the error that you are 
experiencing.


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

Date: Mon, 3 Jul 2000 16:10:07 -0500
From: Joe Digilio <digilio@cig.mot.com>
Subject: Re: formatting output of a process
Message-Id: <Pine.GSO.4.21.0007031554460.1739-100000@triad>

The part I'm having trouble with is keeping the output in order.

I like the idea of using epoch. I think if I use Time::HiRes, I can
keep stdout and stderr seperate, and stamp them with the HiRes
time. That should be able to keep everything in the correct order.

Thanks a bunch!

-Joe


On 1 Jul 2000, David Efflandt wrote:

> What part do you have trouble with, getting the data from the external
> program or adding the prefix to each line?  It would be easy to dup
> STDERR to STDOUT and get it all at once.
> 
> To keep track of each separately, I have used a child process with a fifo
> to grab STDOUT from a process while at the same time reading STDERR status
> of the same process from the parent.  When the process was finished I got
> the STDOUT data from the child.  You could reverse this with STDOUT to
> parent and STDERR to child.  But you would need to sort them on the
> timestamp to assemble them into one file.  Initially use time (since the
> epoch) as you grab the data and convert to formatted time (strftime) when
> saving the sorted data.
> 
> Actually I also had an additional child using a fifo to feed data into the
> process while piping converted STDERR status to a 'dialog' graph (parent,
> 2 children and 2 external processes at the same time).
> 
> -- 
> David Efflandt  efflandt@xnet.com  http://www.de-srv.com/
> http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
> http://hammer.prohosting.com/~cgi-wiz/  http://cgi-help.virtualave.net/
> 
> 



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

Date: Tue, 4 Jul 2000 01:49:13 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: formatting output of a process
Message-Id: <Pine.GHP.4.21.0007040147310.12223-100000@hpplus03.cern.ch>

On Mon, 3 Jul 2000, Joe Digilio turned usenet upside down and yelled:

> The part I'm having trouble with is keeping the output in order.

How true, how terribly terribly true.


[and another jeopardectomy]




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

Date: Tue, 04 Jul 2000 22:18:50 +0800
From: chee hong <wchong@pacific.net.sg>
Subject: FTP in Perl5
Message-Id: <3961F249.92A6B92E@pacific.net.sg>

Hi there,

I am using Perl5 on my NT server.
When I tried to run my script to ftp from another NT machine,
the following error occurs:

socket.ph missing : No such file or directory

I tried searching for the file in the Perl directory and subdirectories,

but could not find it.

My script starts with 'require "ftp.pl";'.
How do I get around the problem?

Thank you.

Regards,
Kenny



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

Date: Tue, 4 Jul 2000 16:55:15 +0200
From: "Dr. Peter Dintelmann" <Peter.Dintelmann@dresdner-bank.com>
Subject: Re: FTP in Perl5
Message-Id: <8jstt0$1pi2@intranews.dresdnerbank.de>

    Hi,

chee hong schrieb in Nachricht <3961F249.92A6B92E@pacific.net.sg>...
>I am using Perl5 on my NT server.
>When I tried to run my script to ftp from another NT machine,
>the following error occurs:
>
>socket.ph missing : No such file or directory
>
>I tried searching for the file in the Perl directory and subdirectories,
>
>but could not find it.

    that's why the error occured ;-)

>My script starts with 'require "ftp.pl";'.

    install the libnet bundle which which contains Net::FTP.
    It's available from CPAN or ActiveState
    http://www.activestate.com/PPMPackages/5.005/zips/

    Regards,

        Peter





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

Date: Tue, 04 Jul 2000 15:05:48 GMT
From: rara.rasputin@nospam.virgin.net (Rasputin)
Subject: Re: FTP in Perl5
Message-Id: <slrn8m3v8k.1lh.rara.rasputin@cartman.techsupport.co.uk>

wchong@pacific.net.sg <chee hong> wrote:
>Hi there,
>
>I am using Perl5 on my NT server.
>the following error occurs:
>
>socket.ph missing : No such file or directory
>
>could not find it.
>
>My script starts with 'require "ftp.pl";'.
>How do I get around the problem?

Try Net::FTP from CPAN.

-- 

Rasputin.
Jack of All Trades - Master of Nuns.


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

Date: Mon, 10 Jul 2000 09:23:37 GMT
From: stuart_munn@my-deja.com
Subject: GD on HPUX 10.2
Message-Id: <8kc4mf$9td$1@nnrp1.deja.com>

Hello and HELP!

I am trying to compile GD 1.19 on HPUX 10.20.

The main problem I am having is (I think) getting the Makefile.PL to
use gcc instead of the supplied non ANSI C compiler supplied with HPUX.

I have managed to compile the latest version of gcc OK with no errors,
which was amazing to me! (I am not an expert in Makefiles or compilers
to say the least!)

What I want to achieve is to be able to draw bar graphs from a Perl
script.

Can you give me some advice as to how I should set up gcc so that it is
used instead of cc, what I did was

perl Makefile.PL then edited the Makefile and changed the line that
says CC = cc to CC =gcc, but I get the following errors.

# --- MakeMaker constants section:
"Makefile" 599 lines, 16965 characters
euabznm1# make
        gcc -c  -Ae -O      -DVERSION=\"0.10\"  -DXS_VERSION=\"0.10\"
+z -I/opt/perl5/lib/5.00503/PA-RISC1.1/CORE  gdfontg.c
gcc: +z: No such file or directory
*Initialization*:1: missing token-sequence in `#assert'
*** Error exit code 1

I have given up on using the latest GD, though I have installed all the
pre-requistes required using HP depot files from the HPUX Porting and
Archive Centre, shame that they don't have a depot version of GD for
this dummy!

I guess I am missing something obvious?

Hope you have the time to help

Stuart Munn


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


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

Date: Wed, 05 Jul 2000 15:00:43 GMT
From: Robert Brown <rob_99@my-deja.com>
Subject: Getopt::Long usage question
Message-Id: <8jviif$aou$1@nnrp1.deja.com>

Hi list,

I've recenltly discovered the joys of Getopt::Long but I think I'm
missing something:

If I use:
   GetOptions("uid=s"=>\$uid, "pw=s"=>\$pw);

I thought the '=' made the option mandatory.  But when I run the script
with the options, I get no error message.  So how do I check for missing
mandatory options?  If I have to do it myself by using something like:
   die unless ($uid and $pw);

then what's the difference between using '=' and ':'?

TIA,


Rob




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


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

Date: 06 Jul 2000 09:20:23 +0200
From: JVromans@Squirrel.nl (Johan Vromans)
Subject: Re: Getopt::Long usage question
Message-Id: <wl3puorrah4.fsf@plume.nl.compuware.com>

Robert Brown <rob_99@my-deja.com> writes:

> If I use:
>    GetOptions("uid=s"=>\$uid, "pw=s"=>\$pw);
> 
> I thought the '=' made the option mandatory.

Isn't that a little contradictionary? A mandatory option?

> then what's the difference between using '=' and ':'?

It controls whether the _value_ for the option is mandatory or
optional. 

> So how do I check for missing mandatory options? If I have to do it
> myself by using something like: die unless ($uid and $pw);

It would be better to test for defined, otherwise it would choke on
values that would be interpreted as false. Like UID '0'...

-- Johan
   Author and maintainer of Getopt::Long


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

Date: Fri, 07 Jul 2000 18:11:31 +0200
From: TM <thierry.metoudi@netcourrier.com>
Subject: Getting a unique machine ID on win32?
Message-Id: <39660133.E9D06EDB@netcourrier.com>

Hello,

I'm looking for a way of getting a machine's unique ID  (e.g. hard drive
number or a microprocessor ID).

Thanks



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

Date: Fri, 07 Jul 2000 14:35:27 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Getting a unique machine ID on win32?
Message-Id: <396622EF.762A6376@attglobal.net>

TM wrote:
> 
> Hello,
> 
> I'm looking for a way of getting a machine's unique ID  (e.g. hard drive
> number or a microprocessor ID).
> 

An earlier thread discussed this same exact topic.  I recall the 
decided solution was to use a screwdriver.


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

Date: Wed, 5 Jul 2000 18:47:31 +0200
From: "Raphael Pirker" <raphaelp@nr1webresource.com>
Subject: Getting Files sent via attachment?
Message-Id: <8jvp4p$3n2$13$1@news.t-online.com>

Hi,

I want to be able to send Files via a Form. I have a Form to Email processor
running behind the Form. How can I send the Attachment via e-mail? (please
note that I'm a beginner at Perl and I really have no clue about Modules
whatsoever, so I'd appreciate if anyone could point me to a resource or give
me a hint where I don't have to use any modules...)

Thanks in advance,

Raphael




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

Date: 5 Jul 2000 10:07:04 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: Getting Files sent via attachment?
Message-Id: <39636b38@news.victoria.tc.ca>

Raphael Pirker (raphaelp@nr1webresource.com) wrote:
: Hi,

: I want to be able to send Files via a Form. I have a Form to Email processor
: running behind the Form. How can I send the Attachment via e-mail? (please
: note that I'm a beginner at Perl and I really have no clue about Modules
: whatsoever, so I'd appreciate if anyone could point me to a resource or give
: me a hint where I don't have to use any modules...)

: Thanks in advance,

Writing modules is hard (well not really),
but using modules is easy.


Is this an HTML form?  Is the 'Form to Email processor' a CGI script?



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

Date: Wed, 5 Jul 2000 19:24:38 +0200
From: "Raphael Pirker" <raphaelp@nr1webresource.com>
Subject: Re: Getting Files sent via attachment?
Message-Id: <8jvrad$3g8$12$1@news.t-online.com>

> Writing modules is hard (well not really),
> but using modules is easy.
Yeah, but getting used to what you're not used to is harder... :-)

> Is this an HTML form?  Is the 'Form to Email processor' a CGI script?
Both assumptions correct!




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

Date: Thu, 06 Jul 2000 14:39:08 GMT
From: nnyglb@my-deja.com
Subject: Getting Sybase to work on NT 4
Message-Id: <8k25ma$1aj$1@nnrp1.deja.com>

I have installed the DBD for Sybase and am trying to connect to a sybase
11.x database.  Everytime I try to connect, I get the following message:

Open Client Message:
Message number: LAYER = (5) ORIGIN = (3) SEVERITY = (5) NUMBER = (131)
Message String: ct_init(): network packet layer: internal net library
error: Attempt to spawn thread
 failed
install_driver(Sybase) failed: DBD::Sybase initialize: ct_init() failed
at C:/Perl/lib/DynaLoader.pm
 line 219.
Compilation failed in require at (eval 1) line 3.

SQL Advantage and ODBC work fine.  I had no trouble using the DBD for
Oracle.

I have installed the latest DBD and Open Client 11.1.1.  I also have no
problem pinging the server and the port.

Any idea as to what the problem could be???

Thanks in advance

Barry


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


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

Date: Thu, 06 Jul 2000 16:23:10 +0100
From: Ade Talabi <adetalabi@clara.co.uk>
Subject: Re: Getting Sybase to work on NT 4
Message-Id: <3964A45E.17A42EC5@clara.co.uk>

nnyglb@my-deja.com wrote:
> 
> I have installed the DBD for Sybase and am trying to connect to a sybase
> 11.x database.  Everytime I try to connect, I get the following message:
> 
> Open Client Message:
> Message number: LAYER = (5) ORIGIN = (3) SEVERITY = (5) NUMBER = (131)
> Message String: ct_init(): network packet layer: internal net library
> error: Attempt to spawn thread
>  failed
> install_driver(Sybase) failed: DBD::Sybase initialize: ct_init() failed
> at C:/Perl/lib/DynaLoader.pm
>  line 219.
> Compilation failed in require at (eval 1) line 3.
> 
> SQL Advantage and ODBC work fine.  I had no trouble using the DBD for
> Oracle.
> 
> I have installed the latest DBD and Open Client 11.1.1.  I also have no
> problem pinging the server and the port.
> 
> Any idea as to what the problem could be???
> 
> Thanks in advance
> 
> Barry
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.

Might be wrong password, wrong server...interface file

check in that order


-- 
/--------------------------------------------------------------\
| Ade  Talabi     | Internet : adetalabi@clara.co.uk           |
|  ::M1ETW::      | Web Page : http://www.net-africa.com       |
\--------------------------------------------------------------/


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

Date: Thu, 06 Jul 2000 18:17:37 GMT
From: nnyglb@my-deja.com
Subject: Re: Getting Sybase to work on NT 4
Message-Id: <8k2ifm$a8d$1@nnrp1.deja.com>

In article <3964A45E.17A42EC5@clara.co.uk>,
  Ade Talabi <adetalabi@clara.co.uk> wrote:
> nnyglb@my-deja.com wrote:
> >
> > I have installed the DBD for Sybase and am trying to connect to a
sybase
> > 11.x database.  Everytime I try to connect, I get the following
message:
> >
> > Open Client Message:
> > Message number: LAYER = (5) ORIGIN = (3) SEVERITY = (5) NUMBER =
(131)
> > Message String: ct_init(): network packet layer: internal net
library
> > error: Attempt to spawn thread
> >  failed
> > install_driver(Sybase) failed: DBD::Sybase initialize: ct_init()
failed
> > at C:/Perl/lib/DynaLoader.pm
> >  line 219.
> > Compilation failed in require at (eval 1) line 3.
> >
> > SQL Advantage and ODBC work fine.  I had no trouble using the DBD
for
> > Oracle.
> >
> > I have installed the latest DBD and Open Client 11.1.1.  I also have
no
> > problem pinging the server and the port.
> >
> > Any idea as to what the problem could be???
> >
> > Thanks in advance
> >
> > Barry
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
> Might be wrong password, wrong server...interface file
>
> check in that order

Password and user id are correct.  Server is also correct and I assume
since SQL advantage worked the interfaces files is also correct.

My suspicion is that it is something to do with the network driver.
anything more than that I don't have a clue!!


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


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

Date: 04 Jul 2000 00:20:32 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: Getting the exact address of a file received through LWP
Message-Id: <slrn8m2qi6.59a.abigail@alexandra.delanet.com>

Francis Hwang (fhwang@bway.net) wrote on MMCDXCVIII September MCMXCIII in
<URL:news:fhwang-0307001357180001@port001.iris.dialup.bway.net>:
,, Does anybody know how I can tell exactly what file I received from a LWP
,, request? For example, if I pass it a URL "www.domainname.com/path", I
,, could receive either 1) www.domainname.com/path (the file named "path") or
,, 2) www.domainname.com/path/index.html (the index in the directory named
,, "path".) How do I tell which one I just received? I tried looking up info
,, about the response object, and the header object, but wasn't able to find
,, anything that helped.


You cannot. It's up to the server to decide what to send you based on
the URL. It could give you the content of a file, but it also might
dynamically build a page. In fact, a web server might run on a machine
with no disk drive at all! Heck, it doesn't even need a file system,
or even an OS.



Abigail
-- 
    Anyone who slaps a "this page is best viewed with Browser X" label
    on a Web page appears to be yearning for the bad old days, before the
    Web, when you had very little chance of reading a document written on
    another computer, another word processor, or another network.
	    [Tim Berners-Lee in Technology Review, July 1996]


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

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


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