[16019] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3431 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 20 14:10:29 2000

Date: Tue, 20 Jun 2000 11:10:17 -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: <961524617-v9-i3431@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 20 Jun 2000     Volume: 9 Number: 3431

Today's topics:
        Is there a dos htm enviroment for perl ? <smile773@bigfoot.com>
        Msql module installation problems <jaford@watford53.freeserve.co.uk>
    Re: Msql module installation problems <care227@attglobal.net>
    Re: Novell Server and Perl <rootbeer@redcat.com>
    Re: NT or Unix at runtime (Brandon Metcalf)
    Re: Perl Builder 2.0 for LINUX - Beta Available <rootbeer@redcat.com>
        PerlDBI documentation <someone@msn.com>
    Re: PerlDBI documentation <jeff@vpservices.com>
    Re: PerlDBI documentation <cplee@bigfoot.com>
    Re: Problems installing perl5.6 on AIX 4.3.3 (Joe Broz)
    Re: Programming with Perl -melting dowin name, icq into <rootbeer@redcat.com>
    Re: reg expression question <care227@attglobal.net>
    Re: Reg Expression Question <tina@streetmail.com>
    Re: reg expression question <flavell@mail.cern.ch>
    Re: reg expression question (Bart Lateur)
    Re: reg expression question <care227@attglobal.net>
    Re: reg expression question <flavell@mail.cern.ch>
    Re: reg expression question <care227@attglobal.net>
    Re: sbin commands from cgi-bin perl <care227@attglobal.net>
    Re: simple array question (Tad McClellan)
        socket help blogan@chipotle.org
    Re: socket help <care227@attglobal.net>
    Re: starting default cgi file on server <rootbeer@redcat.com>
        Suggestions for returning a range of values (James Weisberg)
    Re: Translating from a code reference back to a functio <andrew.mclaren@swx.ch>
        Urgent help with non-blocking child process required salim@cygnos.com
    Re: Urgent help with non-blocking child process require <tye@metronet.com>
    Re: Viewing Multipart/Mixed messages <rootbeer@redcat.com>
    Re: What the... (Tad McClellan)
    Re: Where to get CPAN CD? (Kenneth Graves)
    Re: Where to get CPAN CD? <gellyfish@gellyfish.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 20 Jun 2000 18:02:06 GMT
From: "smile773" <smile773@bigfoot.com>
Subject: Is there a dos htm enviroment for perl ?
Message-Id: <ykO35.11935$C44.691718@bgtnsc05-news.ops.worldnet.att.net>

Is there a dos html enviroment that I can input data from ?

I would like to use cgi dynamic htm to get info from so that
the perl script writes the info.dat ?







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

Date: Tue, 20 Jun 2000 18:32:26 +0100
From: "Jim Ford" <jaford@watford53.freeserve.co.uk>
Subject: Msql module installation problems
Message-Id: <8io9rd$djk$1@newsg1.svr.pol.co.uk>

Hi

I posted the following question in comp.lang.perl.modules a while ago, but
have not had any replies. Perhaps I'll get more luck in this NG!


>I've been using Msql 1.0.16 on Linux Slackware 7 with a 2.2.13 kernal quite
>happily and now would like to write some (simple!) perl scripts to access
>the database. I'm trying to install Msql-Mysql-modules-1.2214, but have run
>into problems.
>
>When I run 'perl Makefile.PL' I get :-
>Warning: prerequisite Data::ShowTable 0 not found at (eval 13) line 220.
>
>and then when I then run 'make' I get :-
>In file included from ../dbd/dbdimp.h:32,
>                 from dbdimp.c:29:
>../dbd/myMsql.h:55: common/portability.h: No such file or directory.
>
>Now I figured that as I don't have the portabilty.h header it must come
with
>Mysql (which I don't have), so I've tried commenting out the line. It will
>the compile O.K., but I get a few errors when I run the tests. I also can't
>get any sense out of some simple tests on my Msql database.
>
>I'm blundering around in the dark here and could do with a little hand
>holding, please!
>
>Regards: Jim Ford
>
>




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

Date: Tue, 20 Jun 2000 13:38:01 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Msql module installation problems
Message-Id: <394FABF9.DD610274@attglobal.net>

Jim Ford wrote:
> 
> Hi
> 
> I posted the following question in comp.lang.perl.modules a while ago, but
> have not had any replies. Perhaps I'll get more luck in this NG!

Perhaps not.  Just because someone didn't reply in the correct NG 
doesn't give you right to post off topic in what may be a more 
active group.

> 
> >I've been using Msql 1.0.16 on Linux Slackware 7 with a 2.2.13 kernal quite
> >happily and now would like to write some (simple!) perl scripts to access
> >the database. I'm trying to install Msql-Mysql-modules-1.2214, but have run
> >into problems.
> >
> >When I run 'perl Makefile.PL' I get :-
> >Warning: prerequisite Data::ShowTable 0 not found at (eval 13) line 220.

What is confusing about this error?  What is so difficult about
using http://search.cpan.org to get all the modules you need?

Took me 3 seconds to load the page and get the bundle:

http://search.cpan.org/search?mode=module&query=mysql

Then again, this is probably why you were ignored in the 
c.l.p.modules group.


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

Date: Tue, 20 Jun 2000 10:56:01 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Novell Server and Perl
Message-Id: <Pine.GSO.4.10.10006201048280.29843-100000@user2.teleport.com>

On Tue, 20 Jun 2000, Thoren Johne wrote:

> what's up with novell?

The direction away from the center of the earth, just like for everyone
else. :-)

> perl -v on this system gives me now:
> 5.003_07 (Netware build #334)
> 
> is this a very bad dream or just the real truth?

Could be both. Have you tried (to ask an admin) to install a newer
version?

> of course i'd like to use some modules like CGI.pm but i don't think
> they will run with 5.003_07

A lot of useful software won't work with such an old version; when that
version was current, the Macarena was still considered cool, too. An
upgrade is in order. Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 20 Jun 2000 17:11:04 GMT
From: bmetcalf@baynetworks.com (Brandon Metcalf)
Subject: Re: NT or Unix at runtime
Message-Id: <8io8j8$iq7$1@bcrkh13.ca.nortel.com>

lwaibel@cwia.com writes:

 > which OS it's running under?  I'm using 'ccperl' that comes with Rational 
 > ClearCase and it doesn't set the $OSNAME/$^O variable (which is just an 
 > indication of which system it was compiled on, not the run-time anyway).  

Don't use the Perl distribution that comes with clearcase.  It's old and
incomplete.  Install your own.

Brandon


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

Date: Tue, 20 Jun 2000 09:07:32 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Perl Builder 2.0 for LINUX - Beta Available
Message-Id: <Pine.GSO.4.10.10006200906040.29843-100000@user2.teleport.com>

On Tue, 20 Jun 2000, Jonathan Stowe wrote:

> >   chmod -R 777 wine
> >   chmod -R 777 pb2
> > 
> > I think you'll find it a little harder to get away with that kind
> > of thing in the new world you're stumbling into.

> What are we saying here - that it *requires* 'wine' to install or run
> - well then it isnt a linux application is it ?  I think they could do
> with a good slashdotting over this ;-}

I may be mistaken, but I suspect that (at least part of) the point was
that it's rarely correct to set permissions to 777 (recursively yet!). In
fact, it's likely to be a potentially-serious security problem.

Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 20 Jun 2000 11:35:24 -0500
From: "Somebody Special" <someone@msn.com>
Subject: PerlDBI documentation
Message-Id: <BZM35.8$iu4.117423@sol.pdnt.net>


Does anybody know of any mirrors to the DBI home page:
http://www.symbolstone.org/technology/perl/DBI

The main site has been inaccessible for several days and I need to get on
there to finish a project...

Thanks,
Tal




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

Date: Tue, 20 Jun 2000 09:56:26 -0700
From: Jeff Zucker <jeff@vpservices.com>
To: Somebody Special <someone@msn.com>
Subject: Re: PerlDBI documentation
Message-Id: <394FA23A.D783BD01@vpservices.com>

[emailed and posted]

Somebody Special wrote:
> 
> Does anybody know of any mirrors to the DBI home page:
> http://www.symbolstone.org/technology/perl/DBI
> 
> The main site has been inaccessible for several days and I need to get on
> there to finish a project...

You can read docs for all the DBD modules and the DBI FAQ via
www.search.cpan.org.  You can see MJD's tutorial on www.perl.com.  The
O'Reilly site has an online version of one of the chapters of the DBI
book.  If there is something else specific you are looking for, let us
know.

-- 
Jeff


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

Date: Tue, 20 Jun 2000 10:29:44 -0700
From: ChungpingLi <cplee@bigfoot.com>
Subject: Re: PerlDBI documentation
Message-Id: <394FAA08.C381AB73@bigfoot.com>

try http://www.activestate.com


Somebody Special wrote:

> Does anybody know of any mirrors to the DBI home page:
> http://www.symbolstone.org/technology/perl/DBI
>
> The main site has been inaccessible for several days and I need to get on
> there to finish a project...
>
> Thanks,
> Tal

--
A. R. Tech Communication
6814 S. Parker Rd. Foxfield CO 80016
U.S.A. Tel (888)308-9898 Fax (888)860-7594
Andy@bigfoot.com




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

Date: Tue, 20 Jun 2000 17:41:21 GMT
From: jb@yperite.demon.co.uk (Joe Broz)
Subject: Re: Problems installing perl5.6 on AIX 4.3.3
Message-Id: <slrn8kveka.ac.jb@yperite.demon.co.uk>

On Fri, 16 Jun 2000 11:56:46 +0200, Per Weisteen <Per.Weisteen@hydro.com> wrote:
>
>Configure with default values and make seems to work ok.
>Most of the tests completes ok, 99.8% or so.
>I'm then trying to install DBI-1.13 but perl Makefile.PL
>terminates with a core dump.
>Previous version of Perl (5.005.003) worked ok.
>
>Seems I'm getting different results evey time I'm running
>'make test'  ?
>
>Using IBM C Compiler 4.3.0.0. Anyone done this with success

Though it's not the same as what you're trying to do I have installed
DBI-1.13 on AIX 4.3.3 using IBM compiler version 3.6.6 (this is not one of
the Visual Age compilers). If you have support with them you might
ask IBM about this. I think there have been problems reported
trying to compile perl with their most recent compilers. A fix
may be available.



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

Date: Tue, 20 Jun 2000 10:47:50 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Programming with Perl -melting dowin name, icq into a template and password to access directory
Message-Id: <Pine.GSO.4.10.10006201039120.29843-100000@user2.teleport.com>

On Tue, 20 Jun 2000, karen wrote:

> I. 1. name card program for kids that can have a choice of 50 (pictures)
> for examples;

What? 

> 2. email the name card to kids

Perhaps you should preface this list with some sort of an explanation. Or
is this an outline? Although you seem to have "I." above, there's no
"II.". Hmmm.

What's a name card?

> 3. edit the name card  with field name, address, phone, ( icq)
> 4. edit the background of the card

It looks as if the first item in the list is a description of a program,
while the other three are imperatives. Are those last three things you
want the program to do? Are they things it already does?

> 1. How to create template in HTML and so that kids can fill in point #3 in
> the background picture ?

This sounds like a question about HTML. Perhaps you should search for the
docs, FAQs, and newsgroups about HTML.

> 2. How to melt down the point # 3  into a a picture.

At this point, I suspect that English isn't your native language. If you'd
be more comfortable asking your question in another language than English,
feel free to do so. But there may be a more appropriate forum for whatever
you're trying to do.

> 3. How to write a perl to control access of designate directory. Where
> can store the password so the logic is: if the password is correct
> then kids can access the specified directory.

Are you wanting to use a webserver for this? Authentication via username
and password is normally done by the webserver. You should search for the
docs, FAQs, and newsgroups about webservers and perhaps CGI programming
for more information. Reading comp.infosystems.www.authoring.cgi may help
you to get started.

Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 20 Jun 2000 10:46:55 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: reg expression question
Message-Id: <394F83DF.1A71518E@attglobal.net>

Jonathan Stowe wrote:
> 
> 
> ¬ - I always liked that one.
> 

Thats the one I always get when I want something neat like a smiley.

It reminds me of some kind of REXX/VM scripts I've seen...
And then I have nightmares.


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

Date: 20 Jun 2000 15:31:29 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: Reg Expression Question
Message-Id: <8io2oh$588mm$1@fu-berlin.de>

hi,

Tad McClellan <tadmc@metronet.com> wrote:
> On Tue, 20 Jun 2000 02:37:40 GMT, tony_123@my-deja.com <tony_123@my-deja.com> wrote:

>>I have the string
>>
>>$MyString='<img src="http://www.myhouse.com.au/house.gif">';
>>
>>Can someone please tell me how I can extract the house.gif part of this
>>string.

> Here's one way:
>    my $img_name = substr($MyString, 36, 9);

i like that one, but how about that:
($gif) = ($MyString =~ m/(house\.gif)/);

:-)

tina


-- 
http://tinita.de    \  enter__| |__the___ _ _ ___
tina's moviedatabase \     / _` / _ \/ _ \ '_(_-< of
search & add comments \    \ _,_\ __/\ __/_| /__/ perception
"The Software required Win98 or better, so I installed Linux."


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

Date: Tue, 20 Jun 2000 17:30:53 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: reg expression question
Message-Id: <Pine.GHP.4.21.0006201720500.5388-100000@hpplus03.cern.ch>

On Tue, 20 Jun 2000, Drew Simonis wrote:

> It reminds me of some kind of REXX/VM scripts I've seen...
> And then I have nightmares.

Well, REXX is ok, but CMS Pipelines were magic.  Unix pipelines are
distinctly primitive in comparison.  Dataflow programming gives one a
whole different viewpoint.  See e.g
http://www.beyond-software.com/Products/Presentations/Plunging/Plunging.html
#RTFToC12

It wasn't me who originally said it, but "You know what I really miss
in UNIX? CMS Pipelines!" 



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

Date: Tue, 20 Jun 2000 17:00:47 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: reg expression question
Message-Id: <394fa2b5.688320@news.skynet.be>

Jonathan Stowe wrote:

>¬ - I always liked that one. 

The really amuzing thing IMO is how you enter it on a Mac. You push some
magic buttons, and then press "L". Ah! The visual likeliness! Another
magic combination plus "L" gives you "|". Ah... I miss that on a PC.

-- 
	Bart.


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

Date: Tue, 20 Jun 2000 13:11:37 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: reg expression question
Message-Id: <394FA5C9.6D010761@attglobal.net>

"Alan J. Flavell" wrote:
> 
> On Tue, 20 Jun 2000, Drew Simonis wrote:
> 
> > It reminds me of some kind of REXX/VM scripts I've seen...
> > And then I have nightmares.
> 
> Well, REXX is ok, but CMS Pipelines were magic.

/* APNDFILE EXEC */                                           
'pipe (endchar ?)',                                           
  '< FIRST FILE',     /* read FIRST FILE                  */  
  '| a:fanin',      /* combine streams into single stream */        
  '| > THIRD FILE A', /* write merged stream to THIRD FILE*/  
  '?',                /* start of second pipeline         */  
  '< SECOND FILE',    /* read SECOND FILE                 */  
  '| a:'              /* define secondary input for FANIN */            
exit RC                                                       


What an evil beast!


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

Date: Tue, 20 Jun 2000 19:38:07 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: reg expression question
Message-Id: <Pine.GHP.4.21.0006201917320.5388-100000@hpplus03.cern.ch>

On Tue, 20 Jun 2000, Drew Simonis wrote:

> > Well, REXX is ok, but CMS Pipelines were magic.
[...]
> What an evil beast!

If you can come up with a better way to write multidimensional
pipeline networks on a two-dimensional coding sheet, (and with
embedded comments too), feel free.

The orthography of that particular example did leave something
to be desired, I won't dispute that.

cheers




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

Date: Tue, 20 Jun 2000 13:56:59 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: reg expression question
Message-Id: <394FB06B.AC90CAE1@attglobal.net>

"Alan J. Flavell" wrote:
> 
> The orthography of that particular example did leave something
> to be desired, I won't dispute that.

And _that_ was from the help section on my good old VM host.


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

Date: Tue, 20 Jun 2000 10:38:37 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: sbin commands from cgi-bin perl
Message-Id: <394F81ED.DB482521@attglobal.net>

wmcn@my-deja.com wrote:
> 
>  how is it possible to run a /sbin/ command through a perl cgi-script.

What is a /sbin/ command?  This must be brand new Linux jargon.  

> basically, I'm aiming to modify IP address in debian linux
> via supplying form ip of ip, subnet, broadcast addy.
> I cannot seem to execute the command, but can get the basic
> no arg output of the /sbin/ifconfig into a page no problem.

IIRC you must be root to change these params.  What error
are you getting?
 
> I've thought of changing the mod to 6555 but it didn't work,

s/mod/mode/

> even when using a shell script as shown below...

Why use a shell script?

Long story short, I bet 10 to 1 that you are doing this via CGI.  
The script will run with the UID of the process that invoked it, 
specifically the web server.  The UID of the web server won't 
have permission to change network configuration information, nor 
will a normal user.  Try runnning the script as root from the 
command line, and see what happens. 

If it still doesn't work, please post the error that the failure
generated and a usefull bit of code.


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

Date: Tue, 20 Jun 2000 09:56:46 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: simple array question
Message-Id: <slrn8kuu0u.gc2.tadmc@magna.metronet.com>

On Tue, 20 Jun 2000 15:17:10 +1000, Phil Sutcliffe <ils@gil.com.au> wrote:
>"Tad McClellan" <tadmc@metronet.com> wrote in message
>news:slrn8kr4lc.d0s.tadmc@magna.metronet.com...
>> On Mon, 19 Jun 2000 11:07:24 +1000, Phil Sutcliffe <ils@gil.com.au> wrote:
>
>> Friends don't let friends use symrefs.
>
>You have made it blatently obvious that you are no friend of mine, 


What did I say that is "blatently" unfriendly?

Or even a little bit unfriendly?


Symrefs will cause you pain. I am encouraging you to avoid
things that will cause you pain. Doesn't sound unfriendly to me...

I also showed a trivial way to handle the problem that you
said was not trivial. That doesn't sound unfriendly either.



>so why
>can't I use them!


Tom Phoenix posted a URL of why symrefs are bad (because they are
global variables).

Mark-Jason Dominus posted how you can get your job done without
using sym refs.


What's your beef?


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


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

Date: Tue, 20 Jun 2000 06:07:55 -0700
From: blogan@chipotle.org
Subject: socket help
Message-Id: <394F6CAB.E5DA4E76@chipotle.org>

I would like a client written in PERL to communicate via sockets to a
server written in C. I have two pairs of client/server programs, one 
in C and one in PERL. The PERL cleint/server can talk to each other as
can the C client/server. But, the PERL client cannot establish a socket
with the C server, nor can the c client talk to the PERL server.

Will someone please look at the client and server code and give me some
help with what needs to be done to get them communicating with each
other? The OS is Linux.

An Email would also be appriciated.

Thank you for your help,

Here is one clue that might mean something: if the PERL client is set to 
PeetAddr localhost, an error mesgs containing "bad file descriptor" is 
returned. When the PeerAddr is set to 127.0.0.1 or 192.168.0.3 the
script 
dies but no error message is returned. See the chart

server		 client		  error message
l27.0.0.1	localhost	bad file descriptor
localhost	localhost	bad file descriptor
192.168.0.3     localhost   	bad file descriptor
localhost	192.168.0.3	none (script terminates with no mesg)
127.0.0.1	127.0.0.1	none (script terminates with no mesg)
127.0.0.1	192.168.0.3	none (script terminates with no mesg)
192.168.0.3	192.168.0.3	none (script terminates with no mesg)

client.pl
#!/usr/bin/perl
#create socket connection to server    
use IO::Socket;
my $sock = new IO::Socket::INET (
   PeerAddr => localhost,
   PeerPort => 9736,
   Proto => 'tcp',
  );
die "Err: Could not create socket: $!\n" unless $sock;
    
# generate a random number to send to server
$INPUT_VECTOR = int(rand(5)); 
print $sock "$INPUT_VECTOR\n";

#read server's response
$data = <$sock>;    

#print returned value and close socket
print "DATA: $data\n";
    
close $sock;
exit;


server.c
/* socket server */
#include <sys/types.h>
#include <sys/socket.h>
#include <stdio.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/un.h>
#include <unistd.h>

int main() {
    int server_sockfd, client_sockfd;
    int server_len, client_len;
    
    struct sockaddr_in server_address;
    struct sockaddr_in client_address;
      
    /*  create unnamed socket for server */
    server_sockfd = socket(AF_INET, SOCK_STREAM, 0);
    
    /* name the socket */
    server_address.sin_family = AF_INET;
    server_address.sin_addr.s_addr = inet_addr("192.168.0.3");
    server_address.sin_port = 9736;
    server_len = sizeof(server_address);
    bind(server_sockfd, (struct sockaddr *)&server_address, server_len);
    printf("server listening on port: %d\n", server_address.sin_port);
    
    /* create connection queue and wait for clients */
    listen(server_sockfd, 5);
    while(1) {
        char ch;
	printf("server waiting\n");
	
    /* accept connection */
    client_sockfd = accept(server_sockfd, (struct sockaddr
*)&client_address,
        &client_len);
    
    /* read / write to client of client_sockfd */
    read(client_sockfd, &ch, 1);
    ch++;
    write(client_sockfd, &ch, 1);
    close(client_sockfd);
    }
}

-- 
blogan@adnc.com


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

Date: Tue, 20 Jun 2000 11:03:16 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: socket help
Message-Id: <394F87B4.79213261@attglobal.net>

blogan@chipotle.org wrote:
> 
> I would like a client written in PERL to communicate via sockets to a
> server written in C. I have two pairs of client/server programs, one
> in C and one in PERL. The PERL cleint/server can talk to each other as
> can the C client/server. But, the PERL client cannot establish a socket
> with the C server, nor can the c client talk to the PERL server.

Any idea why?  Some kind of error message? 

> 
> Will someone please look at the client and server code and give me some

I seriously doubt it.  You haven't done any work yourself. You
haven't narrowed the problem down to a small scenario.  Instead,
you post entire source (and C source... <gasp>) and expect someone
to come along and do what you were unwilling to do.  If you need 
_assistance_, then tell what your Perl problem is.  What you 
are asking for is free consulting.  Bad form.


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

Date: Tue, 20 Jun 2000 08:35:43 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: starting default cgi file on server
Message-Id: <Pine.GSO.4.10.10006200833230.29843-100000@user2.teleport.com>

On Mon, 19 Jun 2000, Daniel van den Oord wrote:

> Sorry for my poor english what I mean is that I saw on a server that they
> didn't have to put the script file name in the command bar anymore just
> .../cgi-bin/?command=string&blabla
> instead of
> .../cgi-bin/scriptname.cgi?command=string&blabla
> So I thought maybe they are using the script as being the default opening
> page for that directorie
> When I tried that it didn't work it did start the script right but it didn't
> read the command string !!!
> Hope I made myself better understandable ?!? And hope somebody can help me
> !!

If you're more comfortable using another language than English, feel free
to ask your question in that language. But if it's not a Perl question
(and, in asking it twice, you still haven't mentioned Perl, have you?)
perhaps you should instead ask it in a newsgroup about webservers (or
whatever it is that you're really asking about). You may find that reading
comp.infosystems.www.authoring.cgi will help you to get started. Good
luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 20 Jun 2000 17:33:23 GMT
From: chadbour@wwa.com (James Weisberg)
Subject: Suggestions for returning a range of values
Message-Id: <DVN35.6389$HD6.197781@iad-read.news.verio.net>

Hello,

   I was wondering if someone could offer up any suggestions on how I
might implement the following in Perl. I have a script which digs through
a set of databases whose filenames are given by date in the form MMDDYYYY.
The syntax for calling this script is pretty simple. It looks like:

   $ fetch object1,object2... MMDDYYYY,MMDDYYYY,...

   where both objects and dates specify the arguments for the set of  
records and dates that need to be fetched out of the databases. I would
like to augment the syntax to support a range of dates as well:

   $ fetch object1,object2... 05012000-05072000,06012000-06072000 

   would, for example, fetch records for the first week in May 2000 and 
the first week in June 2000. What I would like is a function which splits 
that argument above and creates an array with an element for each unique 
date. In this case there would be 14 date elements in the array for the 
two-week period given. 
   The code to generate the date sequences will get a bit tricky for
crossing month/year boundaries, like 12151999-01152000, but that is 
something I can handle myself. As a simpler case, perhaps a function 
which parses a line like "1-7,14-21" and then creates an array with 
those numbers in the range would be a start.  
 
   Can anyone offer suggestions on how I might procede? Some of this 
is straightforward but its gets a bit more tricky for dates instead of 
numbers. The goal is to then be able to loop over all specific dates 
so that I can then pull out those records in the MMDDYYYY databases.

   Thanx in advance for any suggestions.
 


-- 
World's Greatest Living Poster


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

Date: Tue, 20 Jun 2000 16:06:17 GMT
From: aml <andrew.mclaren@swx.ch>
Subject: Re: Translating from a code reference back to a function name
Message-Id: <8io4p9$dtc$1@nnrp1.deja.com>

In article <Pine.GSO.4.10.10006161449220.21108-
100000@user2.teleport.com>,
  Tom Phoenix <rootbeer@redcat.com> wrote:
> On Fri, 16 Jun 2000, aml wrote:
>
> > Does anyone know how to translate from a code reference back to the
> > full function or method name? If you examine a code reference in the
> > debugger it does this for you, so it's obviously possible, but I
> > haven't a clue how.
>
> Well, there's no guarantee that there _is_ a name for a given code
ref.
> But if there is, you could walk the symbol tables to find it. It may
be
> faster and easier to simply save a copy of the name in the first
place,
> along with the reference. Of course, the question remains: if you're
not
> debugging, what would you need the name for?
>
> Good luck with it!
>
> --
> Tom Phoenix       Perl Training and Hacking       Esperanto
> Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/
>
>

Why would I want this - I half expected this question!

We are porting some Perl logic from Unix to VMS. One of the modules
supports the creation of arbitrary user specific daemon processes
(typically used for transparently holding DB connections open for
command based applications). This works by allowing the calling logic
to declare arbitrary message handlers, then transparently forking a
copy of itself when required to act as the daemon. Of course, on Unix
the forked copy retains all the information on the handler routines (as
code references) and how to activate them.

When running on VMS however, the background process is content free,
and needs to be initialised. We can easily send information based on
handler names across to a newly initialised copy of the script (and
have the code references regenerated), but its a bit harder to send
code references across. I would rather retain the current interfaces if
at all possible - hence the question.

I hadn't considered the issues of anonomous handlers, which would
definitely work in the Unix case, but would not port to VMS.

Thanks

Andrew McLaren


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


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

Date: Tue, 20 Jun 2000 11:29:59 GMT
From: salim@cygnos.com
Subject: Urgent help with non-blocking child process required
Message-Id: <XAI35.1176$yc1.59975@news1.rdc1.on.wave.home.com>

Greetings all,

Below is a complete code for two snippets (snippetA.pl and snippetB.pl) that
summarize a problem i haven't been able to resolve. Your help and feedback
is badly needed. As you could probably tell, sinppetA forks open a child
process connecting to the child's STDIN. Subsequently, snippetA writes dummy
data to snippetB's STDIN. My problem is that when this happens, snippetA
waits until snippetB returns. What I want to be able to do is let A to
continue to execute the loop (hence fork/execing two or more children)
without waiting for any of them to return. so far I haven't had any luck
doing that. Could you please have a look and let me know what is that I am
doing wrong!

SinppetA:

se strict;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
use POSIX qw(:sys_wait_h :signal_h :errno_h);
$SIG{CHLD}=\&REAPER;
$SIG{'HUP'}='SIGhandler';
$SIG{'INT'}='SIGhandler';

use IO::Handle;
require Exporter;
require AutoLoader;

@ISA = qw(Exporter AutoLoader);
$VERSION = '0.01';
my $KeepAlive=0;
my $x=0;
my $y;
while (++$KeepAlive != 3) {
                ++$x;
                $y="\nIteration $x: sample data sent by snippetA\n";
                if (my $pid=open(CHILD, "|-")){
                CHILD->autoflush(1);
                print CHILD $y;
                print "\nSnippetA: iteration $x\n";
                waitpid(-1,&WNOHANG);
                }else{
                exec "perl snippetB.pl";
                }
}

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

snippetB:

#! /usr/bin/perl -w
use strict;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
use POSIX;
use IO::Handle;
require Exporter;
require AutoLoader;

@ISA = qw(Exporter AutoLoader);

setpgid(0,0);
while (<STDIN>) {
    print;
}
close (STDIN);
print "\nsnippetB: ...sleeping\n";
sleep 10;
print "\nsnippetB: ... just woke up\n"

Thanks in advance

Salim


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

Date: 20 Jun 2000 10:40:39 -0500
From: Tye McQueen <tye@metronet.com>
Subject: Re: Urgent help with non-blocking child process required
Message-Id: <8io39n$krq@beanix.metronet.com>

salim@cygnos.com writes:
)                 if (my $pid=open(CHILD, "|-")){
)                 CHILD->autoflush(1);
)                 print CHILD $y;
)                 print "\nSnippetA: iteration $x\n";
)                 waitpid(-1,&WNOHANG);
[...]
) while (<STDIN>) {
)     print;
) }
) close (STDIN);

Process B is waiting for end of file which process A never
provides.  Either add C<close(CHILD)> to A or have B only
read a single line.  But I don't think that is the problem
that you were complaining about which makes me suspect
your code or my thinking.

The problem you are complaining about might be due to the fact
that:

    open(CHILD,

closes any handle previously opened using C<CHILD>, which will
cause Perl [in your case] to wait for the child to finish.  So you
need to generate several different Perl file handles.  There are a
nearly endless number of ways to do this but you might want to use
one of the IO:: modules, simply because that may prevent your mind
from having to try to understand some strange bits of Perl's
internals.
-- 
Tye McQueen    Nothing is obvious unless you are overlooking something
         http://www.metronet.com/~tye/ (scripts, links, nothing fancy)


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

Date: Tue, 20 Jun 2000 09:20:12 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Viewing Multipart/Mixed messages
Message-Id: <Pine.GSO.4.10.10006200916490.29843-100000@user2.teleport.com>

On Mon, 19 Jun 2000, Ramesh Vadlapatla wrote:

> Let's say I have a multipart/mixed message that contains:
> Content-Type: TEXT/PLAIN; charset=US-ASCII
> and
> Content-Type: APPLICATION/octet-stream; name="test.JPG"
> 
> How would I display this file(message) in a browser and display both
> Text as well as the jpg?

Are you writing a browser in Perl? That's probably a poor choice.

> I have the ability to pass it through a script(perl) before I display
> it on the browser.

> So what header information should I pass?

What Perl problem are you trying to solve here? Are you trying to write a
program which will tell a browser to do something? Perhaps you should
search for the docs, FAQs, and newsgroups about browsers and how to talk
to them.

> Any pointers(modules) to implement this would be helpful.

I often recommend strict.pm. :-)  But if you want more modules, search
CPAN.

    http://search.cpan.org/

Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 20 Jun 2000 10:04:04 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: What the...
Message-Id: <slrn8kuuek.gc2.tadmc@magna.metronet.com>

On Mon, 19 Jun 2000 22:58:46 -0700, Agentkhaki <altavistaNOalSPAM@agentkhaki.com.invalid> wrote:

>I guess my question is how to I reset the file
>permissions


To do it under Unix:

   man chmod


To do it in Perl:

   perldoc -f chmod

(don't forget the leading zero in the first argument)


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


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

Date: Tue, 20 Jun 2000 13:47:53 GMT
From: kag@kag.citysource.com (Kenneth Graves)
Subject: Re: Where to get CPAN CD?
Message-Id: <slrn8kutgc.d0.kag@kag.citysource.com>

In article <8in266$cki$1@slb3.atl.mindspring.net>, Paul Rubin wrote:
>I don't mind if the CD is a few months behind.

Walnut Creek: http://www.cdrom.com/

Looks like they cut a new CPAN disk 2 or 3 times a year.  The latest
is dated May, 2000.

--kag



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

Date: Tue, 20 Jun 2000 15:49:24 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Where to get CPAN CD?
Message-Id: <8oM35.416$My4.40110@news.dircon.co.uk>

On Tue, 20 Jun 2000 13:47:53 GMT, Kenneth Graves Wrote:
> In article <8in266$cki$1@slb3.atl.mindspring.net>, Paul Rubin wrote:
>>I don't mind if the CD is a few months behind.
> 
> Walnut Creek: http://www.cdrom.com/
> 
> Looks like they cut a new CPAN disk 2 or 3 times a year.  The latest
> is dated May, 2000.
> 

Which will have been outdated the day after they took the snapshot though.


/J\


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

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


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