[15868] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3281 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 7 18:15:44 2000

Date: Wed, 7 Jun 2000 15:15:32 -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: <960416132-v9-i3281@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 7 Jun 2000     Volume: 9 Number: 3281

Today's topics:
    Re: Perl and memory consumption <jasonb885@my-deja.com>
    Re: Perl and memory consumption <jasonb885@my-deja.com>
    Re: Perl and memory consumption <godzilla@stomp.stomp.tokyo>
    Re: Perl and memory consumption <jasonb885@my-deja.com>
    Re: Perl and memory consumption <dan@tuatha.sidhe.org>
    Re: Perl and memory consumption <dan@tuatha.sidhe.org>
    Re: Perl and memory consumption <godzilla@stomp.stomp.tokyo>
    Re: Perl and memory consumption <dan@tuatha.sidhe.org>
    Re: Perl Crypt function (Bart Lateur)
    Re: PERL developer wanted (David H. Adler)
    Re: perl editor for linux (David H. Adler)
        perl locale set in redhat 6.0 <zhms@netease.com>
    Re: Perl Shortcut? <lr@hpl.hp.com>
    Re: Perl Shortcut? (Abigail)
        perl5.6.0 locale set in redhat 6.0 <zhms@netease.com>
        perldoc & perlop man page? <helza@planet.nl>
    Re: PLEASE HELP: Perl for WWW <rosie@dozyrosy.demon.co.uk>
    Re: problem with parsing data!! <gellyfish@gellyfish.com>
        Read/write in socketpair with forked Childs <jk@sinatra.inka.de>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 07 Jun 2000 20:31:43 GMT
From: |Odo| <jasonb885@my-deja.com>
Subject: Re: Perl and memory consumption
Message-Id: <8hmbff$hs0$1@nnrp1.deja.com>

In article <393E7E45.4A4E3CFE@stomp.stomp.tokyo>,
  "Godzilla!" <godzilla@stomp.stomp.tokyo> wrote:
> Dan Sugalski wrote:
>
> > Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
> > > |Odo| wrote:
>
> > No. There's a very small overhead to using a module,
>
> > Modules certainly *can* take a lot of memory,
>
> Let me know when you have made up your mind
> whether or not modules are memory bloat hogs.

That was unfairly taken out of context -- and you KNOW it.

The point is, the act of "use"ing a module requires little memory,
although obviously that doesn't mean the module ITSELF doesn't take up a
lot of memory.

> Godzilla!
>

--
Sincerely,
Jason Boxman

http://edseek.com/ -
     New Literature Message Boards!


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


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

Date: Wed, 07 Jun 2000 20:38:27 GMT
From: |Odo| <jasonb885@my-deja.com>
Subject: Re: Perl and memory consumption
Message-Id: <8hmbs0$i1a$1@nnrp1.deja.com>

In article <8hkr62$ejd$2@slb6.atl.mindspring.net>,
  ebohlman@netcom.com (Eric Bohlman) wrote:
>
> : I've been trying to use (soft) references as often as possible.
Could I
> : be overlooking things that are increasing memory consumption more
than
> : might otherwise need to occur?
>
> "Soft" references usually means symbolic references.  You shouldn't be
> using those anyway, and they require more memory than hard (true)
> references.

I was really tired last night... I checked the docs and I meant to say
hard references.

> : There must be some HOWTOs or something I overlooked that explain how
to
> : reduce memory consumption / overheat when using Perl.
>
> Did you read the section on "efficiency" in Chapter 8 of the Camel
book?

The Camel book should probably be my next purchase (*everyone gasps in
chorus*: "You don't own it yet?!").  I've read parts of it, but don't
have a friend's copy handy presently.

> I rather suspect that your data structures, not the amount of code
> you have, are the main influence on how much memory you're using.
Watch
> out for cases where you maintain too much "in-process inventory" (e.g.
> reading an entire file into an array, processing the array
line-by-line
> and building another array, and so on).  Avoid constructs like
> "@array=(@array,$newitem)" that make temporary copies of potentially
> large things (remember that once perl grabs memory, it doesn't return
it
> to the system when it becomes unused; it just sets it aside for its
own
> future use).  Watch out for memory leaks.

That sounds like an excellent place for me to start.  Thanks!


>

--
Sincerely,
Jason Boxman

http://edseek.com/ -
     New Literature Message Boards!


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


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

Date: Wed, 07 Jun 2000 14:06:41 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Perl and memory consumption
Message-Id: <393EB961.6C84E29E@stomp.stomp.tokyo>

|Odo| wrote:
>  "Godzilla!" <godzilla@stomp.stomp.tokyo> wrote:
> > Dan Sugalski wrote:
> > > Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
> > > > |Odo| wrote:

> > > No. There's a very small overhead to using a module,

> > > Modules certainly *can* take a lot of memory,

> > Let me know when you have made up your mind
> > whether or not modules are memory bloat hogs.
 
> That was unfairly taken out of context -- and you KNOW it.


Yes, I know Mr. Sugalski deliberately took my comments
out of context, this is very clear.


> The point is, the act of "use"ing a module requires little memory,
> although obviously that doesn't mean the module ITSELF doesn't 
> take up a lot of memory.
 

Yes, modules are memory bloat hogs as you state.

Appears you are aware of some differences. Why then
have you asked a question pertaining to modules and 
memory with prior knowledge of what is and what isn't?
I am challenged to understand why you would ask
a question for which you already know an answer.

How "little" memory for processing would a fairly
stereotypical module use compared to custom coding?
Are you looking to reduce your memory useage or do 
you have something else in mind?

Are you looking for well intended advice given
in good spirit or looking to initiate a flame war 
under the guise of a question?

Godzilla!


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

Date: Wed, 07 Jun 2000 20:55:47 GMT
From: |Odo| <jasonb885@my-deja.com>
Subject: Re: Perl and memory consumption
Message-Id: <8hmcs9$itq$1@nnrp1.deja.com>

In article <9oq%4.104242$hT2.421853@news1.rdc1.ct.home.com>,
  Dan Sugalski <dan@tuatha.sidhe.org> wrote:
> |Odo| <jasonb885@my-deja.com> wrote:
> > I've been trying to use (soft) references as often as possible.
Could I
> > be overlooking things that are increasing memory consumption more
than
> > might otherwise need to occur?
>
> Yech. Don't use symbolic references--use hard references. Too
error-prone.
> Hard references are slightly smaller, too, though not enough to make a
> difference really, unless your variables have huge names. (Plus you
can't
> soft-ref lexicals)

It was a late night... I was thinking 'hard', but I wrote 'soft' for
some reason.

> > I attempted to figure out how much memory some of the modules I use
> > consume with top (just total memory, not accounting for shared or
> > anything).  I came up with these figures:
>
> > Perl = 2228KB
>
> Most of this is shareable.

I don't think the Apache RLimitMEM directive looks at how much is
shared, though.  On my box about half of that 2228KB is shared.

> > DBI = 580KB
>
> plus a DBD module, I presume?

Yes.  In my case either DBD::Pg or DBD::mysql depending on the test
platform.

> > Empty Module = 8KB (108K - 100K module penalty)
>
> Empty how? That 8k's a bit high, though if you're using the template
that
> h2xs spits out it's probably about right.

Well, nearly empty.  I included the following:

package EdcomLib::Dummy;

use strict;

BEGIN
{
	use Exporter ();
	use vars qw($VERSION);
	$VERSION = 0.01;
}

sub new {
	my $proto = shift;
	my $class = ref($proto) || $proto;
	my $self = {};
	bless ($self,$class);
	return $self;
}

sub hi {
	my $self = shift;
	return "hi";
}

1;

Is there anything in there that would case it to use 8KB (ignoring the
100K used by the Exporter() 'use')?

>
> > CGI = 296KB
> > First Module Penalty: 100KB
>
> Nope. This is the cost of using the Exporter module I bet.
>
> > I came up with First Module Penalty because using two empty modules
only
> > consumed 8K more, so I guessed that it costs me 100K to use at least
one
> > module.
>
> That's the cost of Exporter, which isn't cheap as you see. A cost you
pay
> only once, though.

I was going through the Exporter() POD and now I'm not sure why I'm
using it at all...  It was in the perlmod POD documentation and I've
been using it in my modules ever since without thinking much about why
I'm using it.

> > Are those figures even remotely accurate?
>
> They look pretty close. Most of that memory isn't written to, though,
so
> it should be shared between Apache child processes. Still not free,
but
> certainly less RAM used. (Assuming you're using mod_perl. If you're
not
> then by all means, start!)

I'd like to use mod_perl or FastCGI, but my IPP doesn't want to install
it due to potential security issues and I don't want to pay for a
dedicated server at the moment.

> > There must be some HOWTOs or something I overlooked that explain how
to
> > reduce memory consumption / overheat when using Perl.
>
> Nope. Care to write one? :) Avoiding POSIX is a good rule of thumb,
using
> mod_perl is another.

I'd like to write one, if I can compile enough information and output it
in a HOWTO of resonable value without just stealing sections from
existing docs. :)

Thanks for the help!


> 					Dan
>

--
Sincerely,
Jason Boxman

http://edseek.com/ -
     New Literature Message Boards!


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


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

Date: Wed, 07 Jun 2000 21:25:22 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Perl and memory consumption
Message-Id: <65z%4.104984$hT2.422777@news1.rdc1.ct.home.com>

Gojira <godzilla@stomp.stomp.tokyo> said, for some ason:
> Dan Sugalski wrote:
>  
>> Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
>> > |Odo| wrote:
>  
>  
>> No. There's a very small overhead to using a module, 

"There's", a contraction for "there is". An uconditional statement--there
is a very small overhead to using a module. A true unconditional
statement, too.

>> Modules certainly *can* take a lot of memory,

Notice the word "can" here. This is a conditional statement--modules can
take a lot of memory. Not *do*, *can*. They certainly don't have to--there
are 

> Let me know when you have made up your mind 
> whether or not modules are memory bloat hogs.

Both statements, along with the contextual bits you snipped out, were
quite clear, as were the explanations of exactly what overhead modules
impose. If you want I can state it again in simpler language for you. (I
had assumed that english was your native language, for which I apologize,
as that's apparently not the case)

The simplest module is this:

  package foo;
  1;

and that has trivial overhead. The only difference between that code as a
module and that code in your program is the filename entry in %INC.

On the other hand, a module could look like this

  package foo;
  "-" x 2**23;

in which case that module will suck down a touch more than eight meg. That
memory usage, however, has nothing to do with the code being in a module.

The only place you will see extra overhead is if the module brings in code
you don't need. That is a legitimate issue, certainly, but hardly an issue
of the magnitude you make it.

					Dan


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

Date: Wed, 07 Jun 2000 21:45:46 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Perl and memory consumption
Message-Id: <eoz%4.104986$hT2.422503@news1.rdc1.ct.home.com>

|Odo| <jasonb885@my-deja.com> wrote:
> In article <9oq%4.104242$hT2.421853@news1.rdc1.ct.home.com>,
>   Dan Sugalski <dan@tuatha.sidhe.org> wrote:

>> > Empty Module = 8KB (108K - 100K module penalty)
>>
>> Empty how? That 8k's a bit high, though if you're using the template
>> that
>> h2xs spits out it's probably about right.

> Well, nearly empty.  I included the following:

> package EdcomLib::Dummy;

> use strict;

> BEGIN
> {
> 	use Exporter ();
> 	use vars qw($VERSION);
> 	$VERSION = 0.01;
> }

FWIW that BEGIN isn't stricty necessary.

> sub new {
> 	my $proto = shift;
> 	my $class = ref($proto) || $proto;
> 	my $self = {};
> 	bless ($self,$class);
> 	return $self;
> }

> sub hi {
> 	my $self = shift;
> 	return "hi";
> }

> 1;

> Is there anything in there that would case it to use 8KB (ignoring the
> 100K used by the Exporter() 'use')?

Sure. You've a chunk of code that perl needs to parse. 8K sounds about
right for the generated optree plus the bits that Exporter sets up.

>> That's the cost of Exporter, which isn't cheap as you see. A cost you
>> pay
>> only once, though.

> I was going through the Exporter() POD and now I'm not sure why I'm
> using it at all...  It was in the perlmod POD documentation and I've
> been using it in my modules ever since without thinking much about why
> I'm using it.

It handles the exportation of symbols into the callers package if you do
that. If your module doesn't export anything then it's not really
necessary. Likely loaded anyway by someone else, but you can toss its use
and cut out its extra overhead.

>> > Are those figures even remotely accurate?
>>
>> They look pretty close. Most of that memory isn't written to, though,
> so
>> it should be shared between Apache child processes. Still not free,
> but
>> certainly less RAM used. (Assuming you're using mod_perl. If you're
> not
>> then by all means, start!)

> I'd like to use mod_perl or FastCGI, but my IPP doesn't want to install
> it due to potential security issues and I don't want to pay for a
> dedicated server at the moment.

Ah. Well, then, toss POSIX if you can, and take a look to see what you're
using CGI.pm for. If it's just for some HTML shortcuts then don't bother
with it. If you're parsing form data or something like that then keep it.
Might want to look at a smaller time/date handling module.

>> Nope. Care to write one? :) Avoiding POSIX is a good rule of thumb,
> using
>> mod_perl is another.

> I'd like to write one, if I can compile enough information and output it
> in a HOWTO of resonable value without just stealing sections from
> existing docs. :)

Hey, even that would help. Gathering scattered bits together in one place
where they're easy to find can be amazingly helpful.

				Dan


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

Date: Wed, 07 Jun 2000 14:48:46 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Perl and memory consumption
Message-Id: <393EC33E.AB9C2DFF@stomp.stomp.tokyo>

Dan Sugalski wrote:
 
> Gojira <godzilla@stomp.stomp.tokyo> said, for some ason:
> > Dan Sugalski wrote:
> >> Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
> >> > |Odo| wrote:

> The only place you will see extra overhead is if the 
> module brings in code you don't need. That is a legitimate
> issue, certainly, 


Not so difficult to be realistic, yes?

This type of discourse I respect, when you
leave out exaggeration and personal insult.

So, yes there are common circumstances when
a module will bloat your memory by a very
significant percentage factor. I will stand
by my loose, rough, unscientific guesstimation,
averaging all modules together, you can expect
a bloat factor of one-thousand percent.

Perhaps then, what I have suggested, is very
valid advice; don't use a module unless you
have a darn good reason.


Godzilla!


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

Date: Wed, 07 Jun 2000 21:53:00 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Perl and memory consumption
Message-Id: <0vz%4.104987$hT2.422503@news1.rdc1.ct.home.com>

Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
> |Odo| wrote:
>>  "Godzilla!" <godzilla@stomp.stomp.tokyo> wrote:
>> > Dan Sugalski wrote:
>> > > Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
>> > > > |Odo| wrote:

>> > > No. There's a very small overhead to using a module,

>> > > Modules certainly *can* take a lot of memory,

>> > Let me know when you have made up your mind
>> > whether or not modules are memory bloat hogs.
>  
>> That was unfairly taken out of context -- and you KNOW it.


> Yes, I know Mr. Sugalski deliberately took my comments
> out of context, this is very clear.

No, actually I didn't. Your comments were taken very much in context, 
which I see you've snipped.

The overhead of using a modue is exactly one entry in the %INC hash. This
would be a "memory bloat hog" how, exactly? (This is the same overhead you
pay if you require a file)

>> The point is, the act of "use"ing a module requires little memory,
>> although obviously that doesn't mean the module ITSELF doesn't 
>> take up a lot of memory.
>  

> Yes, modules are memory bloat hogs as you state.

Not intrinsicaly they aren't. You may well have a module or three that you
rail against as bloated, but that means specific modules are bloated (for
your purposes at least), not all modules.

Modules can have code in them that you aren't using in the program that
includes them, which could legitiately be considered unneeded overhead,
but that's hardly "bloat".

					Dan


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

Date: Wed, 07 Jun 2000 21:28:20 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Perl Crypt function
Message-Id: <3942bab9.3323292@news.skynet.be>

Randal L. Schwartz wrote:

>No.  crypt(1) had nothing to do with crypt(3).  A common confusion.
>crypt(1) used the "WW-II Enigma rotor machine", while crypt(3) (to
>which Perl's crypt() is connected) is based on a modified DES.

Er... on SOME platforms. Perl's crypt() is compatible with the crypt()
used by the OS to encrypt passwords, so you can (surprise!) encrypt
passwords so that they are usable by the OS.

On the Non-USA version of FreeBSD, the passwords are encrypted using
MD5, not DES, and the results look quite a bit different. And on such a
platform, Perl produces the same odd looking thing.

        print crypt("What's up, Doc?", 'zx');
-->
        $1$zx$x8mxtG8WFcSvEa3JsBU9.1


p.s. It's "crypt", not "Crypt". What is with people (or is it the spell
checker?) that they randomly change the case for Perl keywords? Perl is
case sensitive. So is Unix (and related). Even the man pages (on
FreeBSD) do this. If a sentence starts with the program name, the name
is capitalized. Argh! This computer speek, not English!

-- 
	Bart.


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

Date: 7 Jun 2000 21:46:12 GMT
From: dha@panix.com (David H. Adler)
Subject: Re: PERL developer wanted
Message-Id: <slrn8jtgl4.l8h.dha@panix6.panix.com>

On Thu, 01 Jun 2000 06:41:48 GMT, dninfo7454@my-deja.com
<dninfo7454@my-deja.com> wrote:

>Hostels.com is seeking a PERL developer for occassional projects mostly

You have posted a job posting or a resume in a technical group.

Longstanding Usenet tradition dictates that such postings go into
groups with names that contain "jobs", like "misc.jobs.offered", not
technical discussion groups like the ones to which you posted.

Had you read and understood the Usenet user manual posted frequently
to "news.announce.newusers", you might have already known this. :)

Please do not explain your posting by saying "but I saw other job
postings here".  Just because one person jumps off a bridge, doesn't
mean everyone does.  Those postings are also in error, and I've
probably already notified them as well.

If you have questions about this policy, take it up with the news
administrators in the newsgroup news.admin.misc.

There is a Perl Jobs Announce list that may be more helpful to you.  See
<http://www.pm.org/mailing_lists.shtml> for details.

Yours for a better usenet,

dha


-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"Take myself, subtract films, and the remainder is zero"
 - Akira Kurosawa


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

Date: 7 Jun 2000 21:48:27 GMT
From: dha@panix.com (David H. Adler)
Subject: Re: perl editor for linux
Message-Id: <slrn8jtgpb.l8h.dha@panix6.panix.com>

On 6 Jun 2000 14:08:07 GMT, Csaba Raduly <csaba_r@my-deja.com> wrote:
>04 Jun 2000: A formal bug report was sent to Seti@Home, because the
>following message originated from dgrogan@virginia.edu (David Grogan)
>was reported as containing signs of intelligence: 
>
>>I didn't know emacs did syntax highlighting.
>[snip]
>*Chuckle*
>Is there something EMACS *can't* do ? :-)

Keep this thread from reoccuring every week, apparently... :-/

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
Your pluck is admirable.  However, arguing for a 'pure computer
science' approach in the perl5-porters mailing list is somewhat like
inquiring about mileage in a Maserati dealership.  People are given to
drop their champagne glasses and stare. - Felix Gallo, p5p


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

Date: Wed, 7 Jun 2000 17:44:50 +0800
From: "zhms" <zhms@netease.com>
Subject: perl locale set in redhat 6.0
Message-Id: <8hl5di$29vv$1@news.cz.js.cn>

i always got fails in setting locale to jp or chinese.
(ja, zh_CN.GB2312); any idea?
thanks.
zhms




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

Date: Wed, 7 Jun 2000 12:59:00 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Perl Shortcut?
Message-Id: <MPG.13a8495c3d37e06a98ab3a@nntp.hpl.hp.com>

In article <7aya4hqxqr.fsf@merlin.hyperchip.com> on Wed, 07 Jun 2000 
16:09:15 GMT, Ala Qumsieh <aqumsieh@hyperchip.com> says...
> 
> chadbour@wwa.com (James Weisberg) writes:

 ...

> >    I was wondering if there was a shortcut to initializing the
> > subkeys of a hash slice. Something like:
> > 
> >    @stats{@teams}{wins} = (0) x @teams;

 ...

> If this is all you want then:
> 
> 	@stats{@teams} = ({wins => 0}) x @teams;
> 
> should do what you want.

Note, though, that this replaces any existing hashes, which may have had 
other keys also.  To preserve existing data other than ->{wins}, use 
Greg Bacon's for-loop.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 7 Jun 2000 20:53:43 GMT
From: abigail@arena-i.com (Abigail)
Subject: Re: Perl Shortcut?
Message-Id: <8hmcon$qli$1@news.panix.com>

On Wed, 7 Jun 2000 12:59:00 -0700, Larry Rosler <lr@hpl.hp.com> wrote:
++ In article <7aya4hqxqr.fsf@merlin.hyperchip.com> on Wed, 07 Jun 2000 
++ 16:09:15 GMT, Ala Qumsieh <aqumsieh@hyperchip.com> says...
++ > 
++ > chadbour@wwa.com (James Weisberg) writes:
++ 
++ ...
++ 
++ > >    I was wondering if there was a shortcut to initializing the
++ > > subkeys of a hash slice. Something like:
++ > > 
++ > >    @stats{@teams}{wins} = (0) x @teams;
++ 
++ ...
++ 
++ > If this is all you want then:
++ > 
++ > 	@stats{@teams} = ({wins => 0}) x @teams;
++ > 
++ > should do what you want.
++ 
++ Note, though, that this replaces any existing hashes, which may have had 
++ other keys also.  To preserve existing data other than ->{wins}, use 
++ Greg Bacon's for-loop.

But what is worse, ({wins => 0}) x @teams doesn't give you @teams
different anon hashes, but each reference is the same!

Every team will end up with the same amount of wins.

You'd have to do:

      @stats {@teams} = map {{wins => 0}} 1 .. @teams;

But that still doesn't solve the problem Larry pointed out.


Abigail


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

Date: Wed, 7 Jun 2000 17:48:09 +0800
From: "zhms" <zhms@netease.com>
Subject: perl5.6.0 locale set in redhat 6.0
Message-Id: <8hl5dj$29vv$2@news.cz.js.cn>

i always got fails in setting locale to jp or chinese.
(ja, zh_CN.GB2312); any idea?

i use bash.

export LC_ALL=zh_CN.GB2312;
export LANG=zh_CN.GB2312;
i want let /\b/, quotemeta to work with Chinese, but when
i run perl, it told me the configuration of locale is wrong.

thanks.
zhms






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

Date: Wed, 7 Jun 2000 23:39:20 +0200
From: "Helza" <helza@planet.nl>
Subject: perldoc & perlop man page?
Message-Id: <8hmfj3$8qphj$1@reader2.wxs.nl>

Hi,

I have the problem that i'm still learing to write perl, and directly
started out with a pretty difficult project for myself.

Now the problem is that often if i get stuck somewhere and ask it i get
answers like look it up with perldoc -f commandstuff or look at the perlop
man page or something. However I only have ftp access to my website :( and
running a windows98 computer.

except downloading activeperl which i don't understand how to use i have no
idea how i could get that perldoc info or perlop man stuff.

Is there a sort of webpage where i can find the information like perldoc?
and i have to write upload en run every piece of code i make it takes up
alot of time and never really get errors except error 500 :(

what would be the easiest way for me (on my win98) to install/use perl like
i would on my website but with the debug information?

Greetings Helza






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

Date: Tue, 6 Jun 2000 23:58:44 +0100
From: Rosemary I H Powell <rosie@dozyrosy.demon.co.uk>
Subject: Re: PLEASE HELP: Perl for WWW
Message-Id: <brKhCLAkIYP5EwlI@dozyrosy.force9.co.uk>

In article <8hjk4h$1q0$2@slb2.atl.mindspring.net>, Eric Bohlman
<ebohlman@netcom.com> writes
>JenX (jeniNOjeSPAM@hotbot.com.invalid) wrote:
>: I am totally new to this perl thing. I am a web designer looking
>: to learn scripting and programming languages that apply to the
>: web. One of them is perl.
 ...
>Here's the plan I'd suggest:
>
>1) Go to http://www.activestate.com and get and install the latest 
>version of ActivePerl for Win32.
>
>2) Make sure you're comfortable working at the Windows console prompt 
>(AKA the "Dos command line"); make sure you're comfortable issuing simple 
>commands and editing text files (you can use the DOS "edit" program or 
>Windows Notepad to start).
 ....
>4) Start learning to write simple, command-line Perl programs...

Jeni, As a supplement to Eric's excellent piece of advice, I would
suggest that you find yourself an editor such as PFE (Programmers File
Editor) to type in your Perl scripts; it allows you to test and run your
scripts in a window that will show all (error) messages, and is easier
than running from the DOS command line.

PFE is available free of charge from :
<http://www.lancs.ac.uk/people/cpaap/pfe>
There are other similar editors I believe; you might care to check
discussions on Deja news for alternatives....

Good luck, Rosemary

Oh and PS: ALWAYS use the -w flag to let Perl help you find any syntax
errors, etc :-)
-- 
-------------------------------------------------------------------
| Rosemary I.H.Powell  EMail: Home: rosie@dozyrosy.force9.co.uk   |
|                             Work: r.i.h.powell@rl.ac.uk         |
|                       http://NeedleworkSamplers.com/            |
|                       http://www.CavalierKingCharles.com/       |
|                       http://www.cybercelebrations.com/         |
|                       http://www.dozyrosy.force9.co.uk/         |
-------------------------------------------------------------------


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

Date: 7 Jun 2000 20:59:13 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: problem with parsing data!!
Message-Id: <8hm9ih$oeo$1@orpheus.gellyfish.com>

On Mon, 05 Jun 2000 19:41:14 GMT prakash.ojha@hope.edu wrote:
> I tried following code to parse data submitted through a form, but it
> doesn't work.doesn't give errrors but doesn't do
>  anygood either. can anybody point out what's the problem???
> 
>  &parse_form_data (*form);
> 
>  foreach $key (keys %form){
>  print " $key  $form{$key}";
>  }
> 
> 
>  sub parse_form_data

Dont do that, do this, heres the heavy, heavy monster sound^H^H^H^H^H^H^H
^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^Huse CGI;

/J\
-- 
Well, crying isn't gonna bring him back...unless your tears smell like
dog food. So you can either sit there crying and eating can after can
of dog food until your tears smell enough like dog food to make your
dog come back or you can go out there and find your dog.
-- 
fortune oscar homer


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

Date: Wed, 07 Jun 2000 21:17:02 +0200
From: Joerg Kammerer <jk@sinatra.inka.de>
Subject: Read/write in socketpair with forked Childs
Message-Id: <393E9FAE.B92116CC@sinatra.inka.de>


Hello!

I try to keep connection to my childs in using socketpair
But writing from the parent to the child doesnt yield anything:

The Idea was to keep one connection to each Child.
If the parent has something to say he sends
an Signal, the signal-handler
in the child reads from the pipe,
and updates some internal state in the Child.
This also requires the use of abstract Filehandles to recall
them later.
First I tried to do the Child-reads in the signalhandler with no
success,
but the direct way in the child after fork
doesnt work either.


Has anybody done sth. similar with success..
    (or is unix buffering going to ruin my day ??)

Hope for help

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

use IO::Handle;
use FileHandle; #
use Socket;



%pid_hash=();

$SIG{USR1} = \&notify;


for (1 .. 10) { #ten childs
        $fh_parent= FileHandle->new;
        $fh_child= FileHandle->new;

        #print $fh;
        socketpair($fh_child, $fh_parent, AF_UNIX, SOCK_STREAM,
PF_UNSPEC)
                              or  die "socketpair: $!";
        $fh_child->autoflush(1);
        $fh_parent->autoflush(1);


        unless ($child = fork) {
               #Child
                die "Error with  Fork: $!" unless defined $child;
                close($fh_child);
               $line=<$fh_parent>;
               print STDOUT  "$$ got from:$line\n";
               close $fh_child;
                #while (1) {sleep 10};
                exit;
        }
        #Parent
        close ($fh_parent);
        #print "$child\n";
        push @kids, $child;
        $pid_hash{$child}=$fh_parent; #Zuordnung childpid =>fh_child
}

print "Im the Parent:Mypid:$$\n";

foreach $key (sort keys(%pid_hash)){
        kill USR1 => $key;
        $fh_child= $pid_hash{$key};
        print $fh_child "Hello from parent: $$\n";

}

exit;




############################################################
sub notify {
        print "Notify:$$\n";
        #$line=<$fh_parent>;
        #select (STDOUT);$!=1;
        #print $fh_parent;
        #recv($fh_parent,$line,1,0);
        #print STDOUT  "$$ got from:$line\n";
        #exit;
}






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

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


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