[10347] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3940 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 10 02:07:26 1998

Date: Fri, 9 Oct 98 23:00:21 -0700
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, 9 Oct 1998     Volume: 8 Number: 3940

Today's topics:
        A simple script to POST method (James  Bond  098)
    Re: A simple script to POST method (brian d foy)
    Re: anyone got a rtf->html converter in perl? <mpersico@erols.com>
    Re: Are there any "perl.newbie" group or forum? <mp@mkt2mkt.com>
    Re: Are there any "perl.newbie" group or forum? <eashton@bbnplanet.com>
    Re: Are there any "perl.newbie" group or forum? <mp@mkt2mkt.com>
    Re: Capturing command output in Perl fredi4161@my-dejanews.com
    Re: Convert C struct to Perl -easy one? <mpersico@erols.com>
    Re: Difficulty with HTML & Perl & CGI (brian d foy)
    Re: FTP server, module? (brian d foy)
    Re: Fun with Arrays of Hashes <mpersico@erols.com>
        Here we go a mongering.... <eashton@bbnplanet.com>
    Re: How do I use die? <brettr@centuryinter.net>
    Re: How do you save a state? <mpersico@erols.com>
        How to: Add data to mSQL db from CGI script ? (James D. Meacham)
    Re: Hrm. Linguistic Quandry <mp@mkt2mkt.com>
    Re: Hrm. Linguistic Quandry <mp@mkt2mkt.com>
    Re: Hrm. Linguistic Quandry <eashton@bbnplanet.com>
    Re: Hrm. Linguistic Quandry <eashton@bbnplanet.com>
    Re: Hrm. Linguistic Quandry grimel@icx.net
    Re: HTML extract problem <jdf@pobox.com>
        Looking for redirect-scpt but *not* for a drop-down box fon@cheabit.com
    Re: Looking for redirect-scpt but *not* for a drop-down (brian d foy)
        path problem <piero@ekoidea.most.org.pl>
    Re: Perl FTP API <mpersico@erols.com>
    Re: PERL in Business <mp@mkt2mkt.com>
    Re: prograMing: CompleteIndexSet <xah@best.com>
        references to package subroutines and SIG <mb@cup.hp.com>
    Re: references to package subroutines and SIG <jdf@pobox.com>
    Re: RegExp Hell! (brian d foy)
        Win32::API can't load <richly@samart.co.th>
    Re: Writing an intelligent forking server. <mpersico@erols.com>
    Re: Writing an intelligent forking server. <ed-hill@uiowa.edu>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Sat, 10 Oct 1998 23:38:04 GMT
From: burningboy@hotmail.com (James  Bond  098)
Subject: A simple script to POST method
Message-Id: <361feeff.52544953@news.au.ac.th>

I've seen this script from here, it is

use IO::Socket;

$sock = new IO::Socket::INET(PeerAddr => "www.yahoo.com", PeerPort =>
80);
print $sock "GET / HTTP/1.0\n\n";
while (<$sock>) {
	print;
}

But it's GET method, Could you modify it to POST such some variables
as , name => 'Ryan', age => '20' to 'http://www.abc.com/readdata.pl' ?

Looking forward to your answer, thanks.


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

Date: Sat, 10 Oct 1998 01:35:57 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: A simple script to POST method
Message-Id: <comdog-ya02408000R1010980135570001@news.panix.com>
Keywords: from just another new york perl hacker

In article <361feeff.52544953@news.au.ac.th>, burningboy@hotmail.com (James  Bond  098) posted:

>I've seen this script from here, it is
>
>use IO::Socket;
>
>$sock = new IO::Socket::INET(PeerAddr => "www.yahoo.com", PeerPort =>
>80);
>print $sock "GET / HTTP/1.0\n\n";
>while (<$sock>) {
>        print;
>}
>
>But it's GET method, Could you modify it to POST such some variables
>as , name => 'Ryan', age => '20' to 'http://www.abc.com/readdata.pl' ?

print $sock <<"HERE";
POST /readdata.pl HTTP/1.0
Content-Length: 16
Host: www.abc.com

name=ryan&age=20
HERE

>Looking forward to your answer, thanks.

perhaps you want LWP instead.  there's less reading to do to use it
effectively.

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers needs volunteers! <URL:http://www.pm.org/to-do.html>


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

Date: Fri, 09 Oct 1998 23:48:00 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: anyone got a rtf->html converter in perl?
Message-Id: <361ED8F0.50668B9@erols.com>



Leon Brocard wrote:
> 
> Start with the spec, read and reread it until you think you've
> understood it, and then read it again.
> 

Hmm. Sounds like what I did with Programming Perl <grin>
-- 
Matthew O. Persico
So where is PalmPerl?


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

Date: Fri, 09 Oct 1998 19:38:01 -0800
From: madame philosophe <mp@mkt2mkt.com>
To: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <361ED68C.4D4DE433@mkt2mkt.com>

Hello again,

OK, so I don't know the particulars of newsreaders... could it be the first message
sent to the newsreader?  Or is this really a ridiculous question???

I'm just thinking about making life easier for newbies as well as non-newbies.
(That's not to say that I think my such pondering is the first to contemplate such a
solution to such a problem, I'm sure it has.)

What about implementing a color feature the way the Netscape Mail software can change
the color of a subject header.  Then...I did think about the lovely <blink> tag....
:)



Randal Schwartz wrote:

> >>>>> "madame" == madame philosophe <mp@mkt2mkt.com> writes:
>
> madame> ...still WOULD it be possible to program something that would
> madame> keep the FAQ, and ng proto's at the top of the newsgroup?
>
> What does "top" mean when there are about 60 different newsreaders,
> all with their own policy on sorting?
>
> --
> Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
> Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
> Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
> Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
> Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me





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

Date: Sat, 10 Oct 1998 02:52:00 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <361EC954.9D0CAA8@bbnplanet.com>

madame philosophe wrote:

>   Because I have such respect for your posts Elaine, I would not want to
> cause you a reason to question your intuition.

Oh come now, darling. Intuition isn't fact but feeling with a bit of
instinct. I always reserve the right to be wrong. :)

> However I would have to say Mr. Jars is probably more correct that I'm a
> flamboyant poster, rather than a troll imposter!  :)

C'est la vie. If I am wrong, we will buy you a beer at any boston.pm
meeting you should find yourself attending. 

e.


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

Date: Fri, 09 Oct 1998 20:47:09 -0800
From: madame philosophe <mp@mkt2mkt.com>
To: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <361EE6CC.5BE9FDA@mkt2mkt.com>

> That's completely up to the newsreader.  Right.
>
> madame> What about implementing a color feature the way the Netscape
> madame> Mail software can change the color of a subject header.
> madame> Then...I did think about the lovely <blink> tag....  :)
>
> Really?  All my text is in black and white.  A color wouldn't help
> here.

Then you should make it blink ;)

mp



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

Date: Sat, 10 Oct 1998 03:40:07 GMT
From: fredi4161@my-dejanews.com
Subject: Re: Capturing command output in Perl
Message-Id: <6vmkuo$n9m$1@nnrp1.dejanews.com>

In article <6vg2u7$uu1$1@imsp009a.netvigator.com>,
  "wkchiu" <wkchiu@yahoo.com> wrote:
> I am writing a perl script in NT which runs the PING.EXE command to check a
> node (using system() or win32::create() ??) and examine the reply of
> PING.EXE to see whether the node is alive or dead. My question is how can I
> capture the output of PING.EXE in perl script to carry out the processing ?
>
> wkchiu.
>
>

Hi,
here is a one-line perl script:

print `ping.exe eagle`;

mean while I'm a novice on NT and want to know about using this discussion
forum which I replied from

http://www.dejanews.com/post.xp?NG=comp.lang.perl.misc&SUB=Re:%20Capturing%20com
mand%20output%20in%20Perl&REF=%3c6vg2u7$uu1$1@imsp009a.netvigator.com%3e&AN=3986
71624

-The url of the result page.
Thank you,


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Fri, 09 Oct 1998 23:45:27 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
To: Sean Rietze <seanr@rmci.net>
Subject: Re: Convert C struct to Perl -easy one?
Message-Id: <361ED857.A37928FC@erols.com>

If you are trying to interface to existing 'C' code, so be it. If you
are simply trying to access the socket stuff in a Perl script then

use IO::Socket

-- 
Matthew O. Persico
So where is PalmPerl?


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

Date: Sat, 10 Oct 1998 01:42:40 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Difficulty with HTML & Perl & CGI
Message-Id: <comdog-ya02408000R1010980142400001@news.panix.com>
Keywords: from just another new york perl hacker

In article <361E7330.427D8E34@min.net>, John Porter <jdporter@min.net> posted:


>> print $query->header(),
>>     $query->start_html(-title=>'No Title', -bgcolor=>'white'),
>>     $query->h4({-align=>'center'}, "Testing 4..."),
>>     $query->end_html;

>> I like spacing my code out, personally.  And yeah sure the () after
>> header can go, since it defaults to the Content-type: text/html

>No, technically it can go because subroutine (header) ignores the
>argument list.  () passes no arguments (besides the object ref),
>and leaving it off passes the current @_.  Safe, because the sub
>ignores it.

header() doesn't ignore the argument list:

from CGI.pm:

     header() returns the Content-type: header.  You can provide
     your own MIME type if you choose, otherwise it defaults to
     text/html.  An optional second parameter specifies the
     status code and a human-readable message.  For example, you
     can specify 204, "No response" to create a script that tells
     the browser to do nothing at all.  If you want to add
     additional fields to the header, just tack them on to the
     end:

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers needs volunteers! <URL:http://www.pm.org/to-do.html>


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

Date: Sat, 10 Oct 1998 01:36:47 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: FTP server, module?
Message-Id: <comdog-ya02408000R1010980136470001@news.panix.com>
Keywords: from just another new york perl hacker

In article <361e44bd.0@news.rmci.net>, "Sean Rietze" <seanr@rmci.net> posted:

>Does anyone know  if someone has publised code or a module that
>implements a FTP server in Perl?
>
>If so, where?

when looking for modules, CPAN is a good place to start.

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers needs volunteers! <URL:http://www.pm.org/to-do.html>


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

Date: Sat, 10 Oct 1998 00:03:07 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: Fun with Arrays of Hashes
Message-Id: <361EDC7B.8108852C@erols.com>

Darren Greer wrote:
> 
> Howdy.....Ive got an aray of hashes...and am trying to print one of
> hte values in one of the hashes.....for example:
> 
>         $array[0] = (%hash = ('var1',$var1,'var2,$var2) );

Did this actually work? I'd have written this:

$array[0] = { var1 => $var1,
		var2 => $var2 };

=> is a stand-in for a comma that allows you to skip the quotes on the 
left-hand side. It also makes it very clear you are doing a hash.

The {} creates an anonymous hash and returns a reference to it. You
store
the reference in the $array[0].

Accessing is like this (normally on one line, but split here
for ease of commenting):

	$array[0]	# what you stuck the hash ref into
	->		# says that $array[0] is a reference
	{var1}		# says treat the ref as a hash ref
			# and give me the data associated with
			# the key var1

-- 
Matthew O. Persico
So where is PalmPerl?


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

Date: Sat, 10 Oct 1998 02:58:36 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Here we go a mongering....
Message-Id: <361ECAE1.A9DB38C3@bbnplanet.com>

The boston.pm is having a gathering tomorrow ~6pm EST. Those unable to
join us in our search for better beer and finer scotch should join us on
#mongering on EFnet sometime thereafter. Should we get the quickcam
going we'll post it on the channel.

e.


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

Date: Fri, 9 Oct 1998 23:53:03 -0500
From: "brettr" <brettr@centuryinter.net>
Subject: Re: How do I use die?
Message-Id: <6vmpa2$brt$1@newsread1-mx.centuryinter.net>

I'm running this simple little script for testing:

#!/usr/bin/perl
chdir('/user/printer');
print "Content-type: text/html\n\n";
   print "<HEAD>\n";
   print "   <TITLE>New User</TITLE>\n";
   print "</HEAD>\n";
   print "<BODY>\n";
   print "<P><HR><P></BODY></HTML>\n";

It runs fine. However, if I replace the second line with either of these, I
get Internal Server Error.
chdir('/user/printer')or die();
chdir('/user/printer') or die;

Even using the $! I get the error. From what I've read, that script should
work. Any suggestions?

brettr






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

Date: Fri, 09 Oct 1998 23:52:56 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: How do you save a state?
Message-Id: <361EDA18.32EC30F1@erols.com>

What's a frameset?

Kenneth Hunt wrote:
> 
> I need to keep information on a file pathname which is generated in one
> frame of frameset A, and use that info in another frame in frameset B.
> How can I do that?
> 
> The info in question is passed to frameset B, but how do you transfer
> that info to a frame in frameset B??
> --
> 
> ------------------------------------------------------
> Kenneth Hunt
> SC S12 V321 Rm. C233
> office: 364-7755        pager:  715-0600
> ------------------------------------------------------

-- 
Matthew O. Persico
So where is PalmPerl?


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

Date: 9 Oct 1998 15:14:59 GMT
From: jmeacham@wittgenstein.jhuccp.org (James D. Meacham)
Subject: How to: Add data to mSQL db from CGI script ?
Message-Id: <6vl99j$87m@news.jhu.edu>



So here's my task from the powers that be:

I need to take the input from a form on our web site and have it sent to an 
SQL database.  Now, I've chosen mSQL because I've used it before and it seems 
to have good support in Perl, my CGI language of choice.  Perusing the docs 
for the mSQL module, I noticed that no mention is made of adding data, just 
retrieving it.  So the question is, is there a module or extenstion that will 
allow me to add data to my mSQL database without having to script the enitire 
conversation?  I'm a little new to the database thing, so any help would be 
gratefully accepted.  Peace,

James
--
James David Meacham, 3rd		jmeacham@wittgenstein.jhuccp.org
Web Systems Administrator/Internet Services Coordinator		
Center for Communications Programs	410-659-6367
The Johns Hopkins University		410-659-6266 (fax)



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

Date: Fri, 09 Oct 1998 19:01:45 -0800
From: madame philosophe <mp@mkt2mkt.com>
Subject: Re: Hrm. Linguistic Quandry
Message-Id: <361ECE0E.E3B3850@mkt2mkt.com>




Elaine -HappyFunBall- Ashton wrote:

> Since the word 'troll' came up recently I did a little etymological
> digging and I find myself wondering about it. To troll is fishing
> casually on a long line. To trawl is to fish the bottom. I'm wondering
> if 'troll' is the proper term. Being that I live in a largely seaside
> community the difference is distinct. Perhaps to 'trowel' is the most a
> propos term. To dig and not to fish.

So... you are trowelling for trolls??

Is this akin to dialing for dollars?


> What say you boys?
>

I think a good Mae West quote would fit well here, but I just can't think
of one!

mp




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

Date: Fri, 09 Oct 1998 19:06:16 -0800
From: madame philosophe <mp@mkt2mkt.com>
Subject: Re: Hrm. Linguistic Quandry
Message-Id: <361ECF1D.57C0892F@mkt2mkt.com>

> I say let's trowel up that troll.  Think "Amontillado".
>

I like Amontillado!

hic



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

Date: Sat, 10 Oct 1998 02:42:57 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Hrm. Linguistic Quandry
Message-Id: <361EC736.9D85E7F4@bbnplanet.com>

Charles DeRykus wrote:

> Er,  Elaine was just having a bit of fun - that's from
> "Alice in Wonderland".

Ah, sorry then, I never did like Lewis Carroll. :)

e.


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

Date: Sat, 10 Oct 1998 02:48:27 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Hrm. Linguistic Quandry
Message-Id: <361EC87F.58670E62@bbnplanet.com>

John Porter wrote:

> I say let's trowel up that troll.  Think "Amontillado".

You kill me Mr. Porter! *mwwhaahaaha* :) Ah, Poe.

e.


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

Date: Sat, 10 Oct 98 02:56:37
From: grimel@icx.net
Subject: Re: Hrm. Linguistic Quandry
Message-Id: <361f0610$2$tevzry$mr2ice@news.icx.net>

In <361D8BAA.6DBE307B@bbnplanet.com>, on 10/09/98 
   at 04:16 AM, Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
said:

>Since the word 'troll' came up recently I did a little etymological
>digging and I find myself wondering about it. To troll is fishing
>casually on a long line. To trawl is to fish the bottom. I'm wondering
>if 'troll' is the proper term. Being that I live in a largely seaside
>community the difference is distinct. Perhaps to 'trowel' is the most a
>propos term. To dig and not to fish. What say you boys?

Being as I've fished most of 32yrs of life, trolling is generally
accepted as slowly(relative) cruising the water with a long line behind
the boat.  The idea is to present the bait to a large area in hopes of
catching a fish.  I believe (not being a commerical fisherman) that
trawling involves nets.

George


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

Date: 10 Oct 1998 05:39:02 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: molkiheg@sp.zrz.tu-berlin.de
Subject: Re: HTML extract problem
Message-Id: <m3ww69m6g9.fsf@joshua.panix.com>

molkiheg@sp.zrz.tu-berlin.de (Kay Molkenthin) writes:

> Jonathan Feinberg <jdf@pobox.com> wrote:
> >If you'd show us the perl code that's giving you trouble, we'll be
> >better able to help you.

> sorry but I am not able to because I am not experienced in searching
> & cutting text with perl.

> Perhaps the HTML-code from this page can help you. This is the
> important part of each HTML-file:

It seems like you're hoping someone will write a program for
you. You'll have better luck if you offer money!

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: Sat, 10 Oct 1998 02:16:16 GMT
From: fon@cheabit.com
Subject: Looking for redirect-scpt but *not* for a drop-down box!
Message-Id: <6vmg1g$f3h$1@nnrp1.dejanews.com>

Hello,

I'm looking for a (simple?) redirect-script. BUT: I want it to create a
subdirectory and then a file in this new created dir.

 ..like this example: www.myserver.com/netscape
and then the file index.html in the netscape-directory.
I want to use a meta-tag to redirect the script to another page.

I'm looking for this script - or maybe someone's here who can write this!?
It would be great if the script checks if the dir already exists...

Please eMail me at fon@cheabit.com

Thanks alot.
Martin Geisler

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Sat, 10 Oct 1998 01:32:08 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Looking for redirect-scpt but *not* for a drop-down box!
Message-Id: <comdog-ya02408000R1010980132080001@news.panix.com>
Keywords: from just another new york perl hacker

In article <6vmg1g$f3h$1@nnrp1.dejanews.com>, fon@cheabit.com posted:

>I'm looking for this script - or maybe someone's here who can write this!?

>It would be great if the script checks if the dir already exists...

error checking costs $5 more.

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers needs volunteers! <URL:http://www.pm.org/to-do.html>


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

Date: Sat, 10 Oct 1998 02:09:37 GMT
From: "news.tpnet.pl" <piero@ekoidea.most.org.pl>
Subject: path problem
Message-Id: <01bdf3f2$8239c060$b6f174c3@default>

MY CONFIG is:

Win95 OSR2 
OmniHTTPd v1.01 server (built-in support for CGI scripts and other stuff)
Perl for Win32 from ActiveWare, v5.003_7 build 316

directory path: c:\pulpit\katalog\[index.htm]
CGI dir: c:\httpd\Cgi-Bin\
Perl path: c:\perl\bin\perl.exe

I want to check whether one script will work how this $base_path variable
should 
look like in Win, it has to point to directory path?


thank you for your time, please answer to my private address,
-- 
Piotr Smyrak
piero@ekoidea.most.org.pl


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

Date: Sat, 10 Oct 1998 00:03:33 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
To: cstolpe@us.ibm.com
Subject: Re: Perl FTP API
Message-Id: <361EDC95.8157E8D4@erols.com>

Go to CPAN. Download and install Net::FTP

Chris Stolpe wrote:
> 
> Is there a Perl FTP API available?
> 
> Thanks
> Chris Stolpe

-- 
Matthew O. Persico
So where is PalmPerl?


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

Date: Fri, 09 Oct 1998 19:10:18 -0800
From: madame philosophe <mp@mkt2mkt.com>
To: andy.williams@clara.net
Subject: Re: PERL in Business
Message-Id: <361ED00F.AAAC89CA@mkt2mkt.com>

John Porter has this very intriguing page you may wish to show your boss!

Hope it helps your cause!

http://www.min.net/~jdporter/cgi-bin/perl-stories.cgi


madame p

andy.williams@clara.net wrote:

> I have a bit of a problem, thankfully not code related.
>
> My boss requires justification for using PERL (running on NT with Tk) for a
> business database application. It's a fairly large application and he wants to
> know of any other big companies that use (or are developing) a similar
> application.
>
> Please email me if you're invovled in such a project.
>
> Thanks in advance
>
> Andy Williams
> mailto:andy_williams@pa.press.net
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own





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

Date: Fri, 09 Oct 1998 19:29:24 +0000
From: "Xah" <xah@best.com>
Subject: Re: prograMing: CompleteIndexSet
Message-Id: <6vmg9o$lb4$1@nntp2.ba.best.com>


Damn. I gave a wrong definition in my previous message. I said

>CompleteIndexSet([index1, index2,...]) returns a modified version of input
>in which indexes that can be inferred from other indexes are deleted.

It should be

CompleteIndexSet([index1,index2,...]) returns a modified version of argument
in which indexes that are implied are inserted.


 Xah, xah@best.com
 http://www.best.com/~xah/PageTwo_dir/more.html
 >They love, they share; They love and share and care;
 >Love and share! Share and care!
 >The Itchy and Scratchy Show!


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

Date: Fri, 09 Oct 1998 20:23:51 -0700
From: Marc Bernstein <mb@cup.hp.com>
Subject: references to package subroutines and SIG
Message-Id: <361ED347.C4E21FEB@cup.hp.com>

I know the following works:

$SIG{USR2} = \&SomeSubr;

What if SomeSubr is a method of the SomePkg module referenced by
psomepkg?

$SIG{USR1} = \$psomepkg->SomeSubr;

The above doesn't seem to work for me. Can someone explain and show what
to do to make this work?

Thanks in advance,

Marc

(Please copy to my email address)



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

Date: 10 Oct 1998 05:45:24 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: Marc Bernstein <mb@cup.hp.com>
Subject: Re: references to package subroutines and SIG
Message-Id: <m3u31dm65n.fsf@joshua.panix.com>

Marc Bernstein <mb@cup.hp.com> writes:

> $SIG{USR1} = \$psomepkg->SomeSubr;

  $SIG{WHATEVER} = sub { $obj->method(); };

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: Sat, 10 Oct 1998 01:29:19 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: RegExp Hell!
Message-Id: <comdog-ya02408000R1010980129190001@news.panix.com>
Keywords: from just another new york perl hacker

In article <6vm8ca$400$1@nnrp1.dejanews.com>, nanobreath@my-dejanews.com posted:

>Hello! Hopefully some kind soul will take mercy on me and defeat the reg exp
>demons ... I am trying to truncate a variable at one particular point, and
>then save everything before that point in another variable. For instance,
>
>domain.com
>
>What I want it to do is take everything *before* the . and put it into
>another variable. So, if before is domain.com, after is domain

here are some examples to ponder :)

#!/usr/bin/perl

$data = 'domain.com';

$data =~ m/^(.*?)\./;
$other_variable = $1;
print "1: $other_variable\n";

($other_variable) = $data =~ m/^(.*?)\./g;
print "1b: $other_variable\n";

$data =~ m/^([^.]*)/;
$other_variable = $1;
print "2a: $other_variable\n";

($other_variable) = $data =~ m/^([^.]*)/g;
print "2b: $other_variable\n";

$other_variable = $data;
$other_variable =~ s/^([^.]*).*/$1/;
print "3: $other_variable\n";

$other_variable = $data;
$other_variable =~ s/\..*//;
print "4: $other_variable\n";

($other_variable) = split /\./, $data;
print "5a: $other_variable\n";

$other_variable = (split /\./, $data)[0];
print "5b: $other_variable\n";

$other_variable = substr($data, 0, index($data, '.'));
print "6: $other_variable\n";

$other_variable = '';
$other_variable .= $c while( ($c = substr($data, $i++, 1)) ne '.' );
print "7: $other_variable\n";

__END__

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers needs volunteers! <URL:http://www.pm.org/to-do.html>


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

Date: Sat, 10 Oct 1998 10:35:47 +0700
From: Robert White <richly@samart.co.th>
Subject: Win32::API can't load
Message-Id: <361ED612.D7593F34@samart.co.th>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
I try.......
<BR>use Win32::API;
<BR>$GetPID = new Win32::API("kernel32", "GetCurrentProcessId", [], N);
<BR>$PID = $GetPID->Call();
<P>gets this:
<BR>Can't load 'C:/PERL/site/5.00502/lib/MSWin32-x86-object/auto/Win32/API/API.dll'
for module Win32::API: load_<A HREF="file:One">file:One</A> of the library files needed to run
this application cannot be found at C:/PERL/5.00502/lib/MSWin32-x86-object/DynaLoader.pm
line 168.
<P>1.&nbsp; the dll is in the proper subdirectory
<BR>2.&nbsp; I changed the PER5LIB env setting to use both forward and
backwards slashes
<BR>3.&nbsp; stuck USE LIB&nbsp; at the beginning, both kinds of slashes.
<BR>4.&nbsp; stuck USE LIB with a shorter path
<BR>5.&nbsp; scattered API.DLL and API.PM around liberally.
<P>have run out of bright ideas.
<P>Robert
<BR><A HREF="http://www.bangkok.com/internet/webwizard">http://www.bangkok.com/internet/webwizard</A>
<BR>robertmwhite@hotmail.com
<BR>richly@samart.co.th
<BR>&nbsp;</HTML>



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

Date: Fri, 09 Oct 1998 23:56:09 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: Writing an intelligent forking server.
Message-Id: <361EDAD9.FC09C39D@erols.com>

Best examples I've seen are in the Perl Cookbook. Well worth the $.

ed-hill@uiowa.edu wrote:
> 
> Hello,
> 
> I've written a number of servers in perl (both forking, pre-forking and
> single-threaded), but they have all been pretty simple, get the request,
> send back the data and exit.  I would like to now do something a little
> more complex and I'm not sure if it's possible, can someone point me in
> the right direction or set me straight if it can't be done.
> 
> For this example, assume that my clients are stateless, they make a
> single request to the server, get back the response and then shut down
> their side of the connection (much like a web browser).
> 
> I want to write a forking server that does the following.
> 
>     * The main process sits on a socket and reads in the first line of
>       a clients request.  That line contains a index key that can be
>       reused by multiple requestors (a session indicator).
> 
>     * The main process looks to see if it has already forked a child to
>       handle that session, and if not it forks off a child, shares the
>       socket with the child - and lets the child handle processing the
>       rest of the request. (BUT the child does not die when it is done).
>       The parent updates a hash table eith the pid of the child that is
>       handling that session request and the parent goes back to
>       listening for more requests.
> 
>     * If when the main process gets a request and it has already forked
>       of a child, I want the main program to be able to basically hand
>       off the rest of the incoming request to the already existing
>       child, and then go back to listening for more requests.
> 
> So over time, this server will have various children where each child is
> handling all the transactions for a particular session.
> 
> So there has to be some type of sharing of filehandles between parent
> and child or other trickery that I can't seem to wrap my brain around.
> Does anyone have any advice on implementing what I'm trying to achieve?
> 
> Thanks.
> 
> -Ed Hill (ed-hill@uiowa.edu)
> Software Developer - Information Technology Services - University of Iowa

-- 
Matthew O. Persico
So where is PalmPerl?


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

Date: Sat, 10 Oct 1998 00:00:05 -0500
From: Ed Hill <ed-hill@uiowa.edu>
Subject: Re: Writing an intelligent forking server.
Message-Id: <361EE9D5.21FB4FF4@uiowa.edu>

I have the Perl Cookbook, and it does address issues like standard forking,
pre-forking, and single-threaded servers - but not what I'm trying to do.

-Ed

Matthew O. Persico wrote:
> 
> Best examples I've seen are in the Perl Cookbook. Well worth the $.
> 
> ed-hill@uiowa.edu wrote:
> >
> > Hello,
> >
> > I've written a number of servers in perl (both forking, pre-forking and
> > single-threaded), but they have all been pretty simple, get the request,
> > send back the data and exit.  I would like to now do something a little
> > more complex and I'm not sure if it's possible, can someone point me in
> > the right direction or set me straight if it can't be done.
> >
> > For this example, assume that my clients are stateless, they make a
> > single request to the server, get back the response and then shut down
> > their side of the connection (much like a web browser).
> >
> > I want to write a forking server that does the following.
> >
> >     * The main process sits on a socket and reads in the first line of
> >       a clients request.  That line contains a index key that can be
> >       reused by multiple requestors (a session indicator).
> >
> >     * The main process looks to see if it has already forked a child to
> >       handle that session, and if not it forks off a child, shares the
> >       socket with the child - and lets the child handle processing the
> >       rest of the request. (BUT the child does not die when it is done).
> >       The parent updates a hash table eith the pid of the child that is
> >       handling that session request and the parent goes back to
> >       listening for more requests.
> >
> >     * If when the main process gets a request and it has already forked
> >       of a child, I want the main program to be able to basically hand
> >       off the rest of the incoming request to the already existing
> >       child, and then go back to listening for more requests.
> >
> > So over time, this server will have various children where each child is
> > handling all the transactions for a particular session.
> >
> > So there has to be some type of sharing of filehandles between parent
> > and child or other trickery that I can't seem to wrap my brain around.
> > Does anyone have any advice on implementing what I'm trying to achieve?
> >
> > Thanks.
> >
> > -Ed Hill (ed-hill@uiowa.edu)
> > Software Developer - Information Technology Services - University of Iowa
> 
> --
> Matthew O. Persico
> So where is PalmPerl?


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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