[28612] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9976 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 17 14:05:40 2006

Date: Fri, 17 Nov 2006 11:05:06 -0800 (PST)
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, 17 Nov 2006     Volume: 10 Number: 9976

Today's topics:
        best practice to avoiding excessive memory usage?? <ithinkiam@gmail.com>
    Re: best practice to avoiding excessive memory usage?? xhoster@gmail.com
    Re: best practice to avoiding excessive memory usage?? <ithinkiam@gmail.com>
    Re: best practice to avoiding excessive memory usage?? <m@remove.this.part.rtij.nl>
    Re: best practice to avoiding excessive memory usage?? xhoster@gmail.com
    Re: CPAN problem on sun-sloaris, help me <jgibson@mail.arc.nasa.gov>
        Do I *have* to use 'OOP' to use modules? <merrile@telus.net>
    Re: Do I *have* to use 'OOP' to use modules? <scobloke2@infotop.co.uk>
    Re: Do I *have* to use 'OOP' to use modules? <cwilbur@chromatico.net>
    Re: Do I *have* to use 'OOP' to use modules? <merrile@telus.net>
    Re: Do I *have* to use 'OOP' to use modules? <uri@stemsystems.com>
    Re: Do I *have* to use 'OOP' to use modules? xhoster@gmail.com
    Re: FAQ 5.11 How can I write() into a string? <louisREMOVE@REMOVEh4h.com>
    Re: How can I create instantiable objects (not classes) <julien.ollivier@gmail.com>
    Re: How to make Perl's regex engine "halt" after a matc <louisREMOVE@REMOVEh4h.com>
    Re: howto POST and leave site? <jgibson@mail.arc.nasa.gov>
        Is the WxPerl a wrapper of wxWidgets library ? <struggle@mail.nankai.edu.cn>
        Module help! <struggle@mail.nankai.edu.cn>
    Re: OT: O'Reilly 'Perl CD Bookshelf' - gone for good? <sigzero@gmail.com>
    Re: Perl redirection to browser timeout ... <jgibson@mail.arc.nasa.gov>
    Re: threads crash on XP (in Tk script) <zentara@highstream.net>
    Re: what the difference between these loops? <spam.meplease@ntlworld.com>
    Re: what the difference between these loops? <jgibson@mail.arc.nasa.gov>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 17 Nov 2006 14:38:08 +0000
From: Chris <ithinkiam@gmail.com>
Subject: best practice to avoiding excessive memory usage??
Message-Id: <ejkhga$9no$1@dux.dundee.ac.uk>

I've come across the perl issue of inefficient use of memory when
dealing with large datasets. What are people's opinions on the best way
to work around this problem.

e.g.

My input file has this layout:
# Input 1_8:
0.28496 0.10340 0.33403 0.86176 0.06723 0.15316 0.46009 0.09535 ...
# Output 1_8:
0 0 1
# Input 1_9:
0.38225 0.98944 0.03805 0.04031 0.05417 0.19623 0.07656 0.07944 ...
# Output 1_9:
0 0 1
# Input 1_10:
0.11106 0.02792 0.69635 0.37519 0.01326 0.95435 0.15976 0.01406 ...
# Output 1_10:
0 0 1

With ~73000 pairs of input and outputs. The file is ~260Mb is size.
However when reading the file into an array with the following code
snippet results in 1.2Gb of memory usage:

#!/usr/bin/perl

use strict;
use warnings;

my ($patfile) = @ARGV;

open(my $FH, $patfile) or die;
my @array;
my $flag = 0;
my $i = 0;

while (<$FH>) {
   $flag = 0 if (/^\# Output/);
   $flag = 1 and next if (/^\# Input/);
   if ($flag) {
      chomp;
      print "$i\n";
      $array[$i] = [ split ];
      ++$i;
   }
}
exit;

I've read about the various work-arounds to access the array via a file
on disk, but they don't seem to be very conducive for working with
complex data structures. Can you guys/gals let me know of their
favourite method to work more efficiently as at the moment I'm just
reading/writing the files a bit at a time?
TIA


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

Date: 17 Nov 2006 15:43:48 GMT
From: xhoster@gmail.com
Subject: Re: best practice to avoiding excessive memory usage??
Message-Id: <20061117104423.653$qZ@newsreader.com>

Chris <ithinkiam@gmail.com> wrote:
> I've come across the perl issue of inefficient use of memory when
> dealing with large datasets. What are people's opinions on the best way
> to work around this problem.

That depends entirely on what you are trying to do with the data.  You
haven't shown us anything about what you are trying to do.  The code you
showed us does nohting but take memory and burn CPU cycles.

> e.g.
>
> My input file has this layout:
> # Input 1_8:
> 0.28496 0.10340 0.33403 0.86176 0.06723 0.15316 0.46009 0.09535 ...
> # Output 1_8:
> 0 0 1
> # Input 1_9:
> 0.38225 0.98944 0.03805 0.04031 0.05417 0.19623 0.07656 0.07944 ...
> # Output 1_9:
> 0 0 1
> # Input 1_10:
> 0.11106 0.02792 0.69635 0.37519 0.01326 0.95435 0.15976 0.01406 ...
> # Output 1_10:
> 0 0 1
>
> With ~73000 pairs of input and outputs. The file is ~260Mb is size.
> However when reading the file into an array with the following code
> snippet results in 1.2Gb of memory usage:
>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> my ($patfile) = @ARGV;
>
> open(my $FH, $patfile) or die;
> my @array;
> my $flag = 0;
> my $i = 0;
>
> while (<$FH>) {
>    $flag = 0 if (/^\# Output/);
>    $flag = 1 and next if (/^\# Input/);
>    if ($flag) {
>       chomp;
>       print "$i\n";
>       $array[$i] = [ split ];
>       ++$i;
>    }
> }
> exit;

This program reads in data and does nothing with it.  You may as well
move the "exit" up to just before the "use strict;"

>
> I've read about the various work-arounds to access the array via a file
> on disk,

Which ones?

> but they don't seem to be very conducive for working with
> complex data structures.

Why not?  What problems did you encounter?

> Can you guys/gals let me know of their
> favourite method to work more efficiently as at the moment I'm just
> reading/writing the files a bit at a time?

Reading and writing the files a bit at a time is an efficient method.
At least as far as memory is concerned.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


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

Date: Fri, 17 Nov 2006 16:58:16 +0000
From: Chris <ithinkiam@gmail.com>
Subject: Re: best practice to avoiding excessive memory usage??
Message-Id: <ejkpn2$l0f$1@dux.dundee.ac.uk>

xhoster@gmail.com wrote:

> Chris <ithinkiam@gmail.com> wrote:
>> I've come across the perl issue of inefficient use of memory when
>> dealing with large datasets. What are people's opinions on the best
>> way to work around this problem.
> 
> That depends entirely on what you are trying to do with the data.  You
> haven't shown us anything about what you are trying to do.  The code
> you showed us does nohting but take memory and burn CPU cycles.

Exactly. I was trying to give an example of the inefficient use of
memory by perl - nothing more and nothing less.
[snip]

>>
>> I've read about the various work-arounds to access the array via a
>> file on disk,
> 
> Which ones?

The ones in the FAQ. 'How can I make my Perl program take less memory?'
 
>> but they don't seem to be very conducive for working with
>> complex data structures.
> 
> Why not?  What problems did you encounter?

AFAICS you can either store 1D arrays as lines in file or use some sort
of DB to manage the data. I may use these in the future, but at the
moment I'm looking a reasonably straight forward method to make an
existing program more memory efficient.

> 
>> Can you guys/gals let me know of their
>> favourite method to work more efficiently as at the moment I'm just
>> reading/writing the files a bit at a time?
> 
> Reading and writing the files a bit at a time is an efficient method.
> At least as far as memory is concerned.
> 

OK. That's what I'll do for the time being. However, I'm still
interested in hearing how other people have overcome this problem.
Thanks.


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

Date: Fri, 17 Nov 2006 18:03:47 +0100
From: Martijn Lievaart <m@remove.this.part.rtij.nl>
Subject: Re: best practice to avoiding excessive memory usage??
Message-Id: <pan.2006.11.17.17.03.46.731989@remove.this.part.rtij.nl>

On Fri, 17 Nov 2006 15:43:48 +0000, xhoster wrote:

>> Can you guys/gals let me know of their
>> favourite method to work more efficiently as at the moment I'm just
>> reading/writing the files a bit at a time?
> 
> Reading and writing the files a bit at a time is an efficient method.
> At least as far as memory is concerned.

That is the best method.

Others include:

- Add more memory. 1.26G data usage is not that much and memory is cheap.

- Process the file in stages, producing intermediairy results (and files)
to make the next stage efficient.

- Put the data in a database. (Optionally producing a new datafile from
the database after processing).

M4
-- 
Redundancy is a great way to introduce more single points of failure.



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

Date: 17 Nov 2006 18:00:34 GMT
From: xhoster@gmail.com
Subject: Re: best practice to avoiding excessive memory usage??
Message-Id: <20061117130110.602$ED@newsreader.com>

Chris <ithinkiam@gmail.com> wrote:
> >
> >> Can you guys/gals let me know of their
> >> favourite method to work more efficiently as at the moment I'm just
> >> reading/writing the files a bit at a time?
> >
> > Reading and writing the files a bit at a time is an efficient method.
> > At least as far as memory is concerned.
> >
>
> OK. That's what I'll do for the time being. However, I'm still
> interested in hearing how other people have overcome this problem.

I've used probably dozens of different methods to overcome the problem of
excess memory use, but each one is suited to only specific kinds of
problems.  Changing algorithms to that you don't everything in memory at
once.  Using Perl to transform the problem to something that can be solved
by using the system sort routine.  Changing languages to something more
memory efficient, either entirely or using Inline or just by using Perl to
pre-process into a C-friendly format, then using C, then using Perl to
post-process back into the desired format. Using DBM::Deep.  Storing
"records" as whole strings and splitting them on the fly when needed
(occasionally using tied arrays or hashes to hide this fact).

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


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

Date: Fri, 17 Nov 2006 09:28:21 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: CPAN problem on sun-sloaris, help me
Message-Id: <171120060928215633%jgibson@mail.arc.nasa.gov>

In article <1163759741.718273.16880@f16g2000cwb.googlegroups.com>,
<"pvrprasadu@gmail.com"> wrote:

> HI,
> 
> 
> 
> i installed the cpan shell on sun-solaris10 (sparc) machine.
> 
> 
> 
> While installation of cpan, i opted for the auto configure.

[problems snipped]

> 
> If it is a CPAN configuration problem, then how to do it manually.

Run the cpan shell and enter 'o conf init' to redo the configuration
interactivally. Then 'o conf commit' to save changes (may be saved
automatically, but I am not sure).


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

Date: Fri, 17 Nov 2006 16:46:34 GMT
From: Merrilee Larson <merrile@telus.net>
Subject: Do I *have* to use 'OOP' to use modules?
Message-Id: <KHl7h.6944$_Z2.6942@edtnps89>

Hi...

I'm not sure why, but I can't stand OOP. That's it!

Sooo....is it possible to be fully productive using Perl5 in a non-OOP
fashion? Can I still use modules, etc? Or would I be severely restricting
myself?

I'm *not* a student or professional programmer wannabe -- just an avid
middle-aged geek looking to write/speak some programming language well. My
goal is to fool around developing websites.

To date I'm not a bad hand with bash/ksh; html/css/js. I've tried PHP -- too
verbose for me. C -- too terse. C++/java -- no thanks. I'm also looking at
Lisp/Scheme et al. TIA...
--
duke


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

Date: Fri, 17 Nov 2006 16:56:55 +0000
From: Ian Wilson <scobloke2@infotop.co.uk>
Subject: Re: Do I *have* to use 'OOP' to use modules?
Message-Id: <Sb-dndCzBZVDdMDYnZ2dnUVZ8t-dnZ2d@bt.com>

Merrilee Larson wrote:
> Hi...
> 
> I'm not sure why, but I can't stand OOP. That's it!

Perhaps you're just waiting for an epiphany?

> 
> Sooo....is it possible to be fully productive using Perl5 in a non-OOP
> fashion? Can I still use modules, etc? Or would I be severely restricting
> myself?

Your question is expressed in an overly bipolar fashion, the truth 
probably lies somewhere "fully productive" and "severely restricted".

I think you would probably be OK. You mention web-sites being a primary 
focus, The CGI module has both an OO and a procedural interface.


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

Date: 17 Nov 2006 12:07:32 -0500
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: Do I *have* to use 'OOP' to use modules?
Message-Id: <87veleovcb.fsf@mithril.chromatico.net>

>>>>> "ML" == Merrilee Larson <merrile@telus.net> writes:

    ML> Sooo....is it possible to be fully productive using Perl5 in a
    ML> non-OOP fashion? Can I still use modules, etc? Or would I be
    ML> severely restricting myself?

Perl itself is largely paradigm-agnostic, but a lot of the really
useful modules offer object-oriented interfaces.  

That said, insisting on not using object-oriented approaches in
programming is like insisting that you'll never turn left while
driving: you can still get where you want to go, but you're setting
yourself up for a lot of silly useless complexity.  If you insist on
avoiding OO, you can still be productive in Perl; but avoiding OO is
severely restricting yourself independent of what language you choose.

Charlton


-- 
Charlton Wilbur
cwilbur@chromatico.net


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

Date: Fri, 17 Nov 2006 17:45:43 GMT
From: Merrilee Larson <merrile@telus.net>
Subject: Re: Do I *have* to use 'OOP' to use modules?
Message-Id: <bzm7h.6972$_Z2.5356@edtnps89>

On 2006-11-17, Ian Wilson <scobloke2@infotop.co.uk> wrote:
> Merrilee Larson wrote:
>> Hi...
>> 
>> I'm not sure why, but I can't stand OOP. That's it!
>
> Perhaps you're just waiting for an epiphany?

Maybe... but I seriously doubt it!

 
>> Sooo....is it possible to be fully productive using Perl5 in a non-OOP
>> fashion? Can I still use modules, etc? Or would I be severely restricting
>> myself?
>
> Your question is expressed in an overly bipolar fashion, the truth 
> probably lies somewhere "fully productive" and "severely restricted".

Do you mean to say that C programmers are *less* productive, as a rule,
than C++ programmers?

> I think you would probably be OK. You mention web-sites being a primary 
> focus, The CGI module has both an OO and a procedural interface.

Good to know! Is that typical of most modules, or only a selected few? Is
there a (slick) way of determining this?
--
duke


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

Date: Fri, 17 Nov 2006 13:08:02 -0500
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Do I *have* to use 'OOP' to use modules?
Message-Id: <x7vele54l9.fsf@mail.sysarch.com>

>>>>> "ML" == Merrilee Larson <merrile@telus.net> writes:

  ML> Do you mean to say that C programmers are *less* productive, as a rule,
  ML> than C++ programmers?

it all depends on the coder as usual.

  >> I think you would probably be OK. You mention web-sites being a primary 
  >> focus, The CGI module has both an OO and a procedural interface.

  ML> Good to know! Is that typical of most modules, or only a selected few? Is
  ML> there a (slick) way of determining this?

slick? rtfm is about as slick as you can get. and if you don't like OO
(which makes little sense as perl OO is very simple to write for the
caller), then you can write simple procedural wrappers around the OO
modules you want. there is even a module (i have to look for it) that
can actually mess with exporting procedural subs that share a singleton
object.

but you need to explain why you hate OO it is just another way of
organizing code and it has many advantages (but is no silver bullet).

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: 17 Nov 2006 18:18:16 GMT
From: xhoster@gmail.com
Subject: Re: Do I *have* to use 'OOP' to use modules?
Message-Id: <20061117131852.930$25@newsreader.com>

dnormandin@bsdrocksperlrolls.com wrote:
> Hi...
>
> I'm not sure why, but I can't stand OOP. That's it!

You can't stand writing OOP code, or even just using OO libraries?  In Perl
you can certainly use a lot of OO code without ever writing any.

> Sooo....is it possible to be fully productive using Perl5 in a non-OOP
> fashion? Can I still use modules, etc? Or would I be severely restricting
> myself?

Few modules force you to subclass them in order to use them, so you could
mostly pretend that they aren't OO.  Sometimes you would still have
to use the OO syntax, but you could just pretend it was a weird looking
function call syntax.  If:

$handle->method(@arg)

really bugs you, you could often but not always get away with invoking it
as:

Class::Name::method($handle,@arg)

although that seems to be more like "making things hard for myself" more
than "don't like OO" to me.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


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

Date: Fri, 17 Nov 2006 09:55:26 -0800
From: "Wayne M. Poe" <louisREMOVE@REMOVEh4h.com>
Subject: Re: FAQ 5.11 How can I write() into a string?
Message-Id: <4s6bcgFtkfaaU1@mid.individual.net>

PerlFAQ Server wrote:
> This is an excerpt from the latest version perlfaq5.pod, which
> comes with the standard Perl distribution. These postings aim to
> reduce the number of repeated questions as well as allow the community
> to review and update the answers. The latest version of the complete
> perlfaq is at http://faq.perl.org .
>
> --------------------------------------------------------------------
>
> 5.11: How can I write() into a string?
>
>
>    See "Accessing Formatting Internals" in perlform for an swrite()
>    function.
>
>
>
> --------------------------------------------------------------------

While I am grateful for the great docs and to those who maintain them, 
as an FAQ post on a news group, this one just seems like such a waste. 
Why not bundle the entry this one refers to ("Accessing Formatting 
Internals") ? Yes, one can use their local perldoc, but still, if this 
is meant for a news group, then it's a waste of a post as is :P

Also, I just now checked, and that reference doesn't seem to be very 
helpful either...

$ perldoc -q "Accessing Formatting Internals"
No documentation for perl FAQ keyword `Accessing Formatting Internals' 
found

$ perldoc -f "Accessing Formatting Internals"
No documentation for perl function `Accessing Formatting Internals' 
found




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

Date: 17 Nov 2006 09:51:51 -0800
From: "Julien" <julien.ollivier@gmail.com>
Subject: Re: How can I create instantiable objects (not classes)?
Message-Id: <1163785911.099801.73650@k70g2000cwa.googlegroups.com>

Mumia W. (reading news) wrote:
> It sounds like what you're trying to do is "delegation." Delegation
> occurs when the programmer decides to let one object send those messages
> that it can't understand to another object. For example, an object of
> type Car might receive a message named "ticket," and since a car does

Hi Mumian,

Thanks a lot for replying :)

I think maybe I didn't make myself clear enough, but anyway I am not
sure that delegation as you are describing is what I am trying to do.
To follow your car example, I am trying to instantiate 100 identical
(say red, with AC, auto windows or whatever) Toyota Corollas, but in a
simulation, each instance of the corolla may have a different speed,
driver, location, etc.  So my object defines what the Corolla looks
like off of the assembly line, but an object-instance has additional
attributes with state information.  I could just add a "speed"
attribute to the Corolla object and instantiate it 100x, but it seems
to me a waste of memory because a subset of the Corolla attributes are
shared and indentical across all the instances of the Corolla class.

Another way to put my question is, how to share the values of a subset
of attributes of a given class across all instances of that class?

Julien



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

Date: Fri, 17 Nov 2006 09:45:25 -0800
From: "Wayne M. Poe" <louisREMOVE@REMOVEh4h.com>
Subject: Re: How to make Perl's regex engine "halt" after a match
Message-Id: <4s6arsFu8n52U1@mid.individual.net>

[This is a reply to a thread from earlier this year
 Reply generated from source post with full headers
 from groups.google.com]

robic0 wrote:
> On 18 Feb 2006 07:48:30 -0800, "Dominic van der Zypen"
> <dominic.zypen@gmail.com> wrote:
>
>> Hello!
>>
>> I'd like to do the following:
>>
>> Given just one line of text, match every occurrence of a double
>> letter and push those double letters on @my_stack. Say, if we are
>> given
>>
>> $line = "This line contains some occurrences of double letters,
>> hoorray";
>>
>> then I want @my_stack to end up containing "cc", "rr", "tt", "oo",
>> "rr";
>>
>> Everything I tried so far just put the first occurrence of double
>> letters (in this example, "cc") on the stack, even if I used the /g
>> option for my match. I suppose the regex engine matched every
>> occurrence, but somehow it didnt "halt" and "care to push" every
>> single one of the on @my_stack.
>>
>> So... how should I go about the above problem?
>>
>> Many thanks for your help!! Dominic
>
> This is trivial. Why would you need this?
> I would consider this a waste of my time to even read such a
> proposition.
> If you can't post a real world problem/question then don't post
> here...

I was reading this on google groups archives and I just had to reply to 
it. I understand I'm a few months late, but being in the hospital at 
that time fighting cancer I hope is a good enough reason.

I'm actually surprised no one responded to this post at the time it was 
originally posted.

Since when can one not post a simplified version of the problem to make 
it easier to trouble shoot? Isn't that what you are SUPPOSED to do? 
Rather than posting a longer code snippet where one would have to sift 
through the code to find the real problem?

Or maybe that's just me. 




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

Date: Fri, 17 Nov 2006 09:18:05 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: howto POST and leave site?
Message-Id: <171120060918058652%jgibson@mail.arc.nasa.gov>

In article <1163734145.291615.10440@k70g2000cwa.googlegroups.com>,
botfood <botfood@yahoo.com> wrote:

> 
> > here: many (most?) people using Perl are not using it for CGI.)
> -----
> ...I wonder. That really is ALL I use perl for; not being a sys admin,

I use Perl and am neither a web developer nor a sys admin. While I have
written and maintain a few Perl CGI scripts, 95% of the Perl programs I
write are run using the command line from a Unix shell. So you can stop
wondering.


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

Date: Fri, 17 Nov 2006 23:05:38 +0800
From: Bo Yang <struggle@mail.nankai.edu.cn>
Subject: Is the WxPerl a wrapper of wxWidgets library ?
Message-Id: <ejkl6j$q70$1@news.cn99.com>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

I think wxPerl is just a wrapper of wxWidgets library just like
wxPython , but I found wxPerl could be used without any wxWidgets
library installed in my computer. How wxPerl implemented? Isn't it
a wrapper ?
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFXc/B7tZp58UCwyMRAhkuAKCsmLYBfvLybg0xRBtPPd43DIfunwCfb36f
OW8pyKVyT8oAND4ofKCeJUQ=
=RqHz
-----END PGP SIGNATURE-----


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

Date: Fri, 17 Nov 2006 23:23:06 +0800
From: Bo Yang <struggle@mail.nankai.edu.cn>
Subject: Module help!
Message-Id: <ejkm7c$ql8$1@news.cn99.com>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

I have search in cpan and google, but failed.
I want to use PKI in perl, is there any module
for this function?

Thanks in advance!
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFXdPa7tZp58UCwyMRAi+0AJ0RYEounG/CFx6oLaaSbqe5f8ebtwCfbzbI
ieBM+owEZDO2bVJK2AQIY/U=
=3SAa
-----END PGP SIGNATURE-----


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

Date: 17 Nov 2006 09:05:39 -0800
From: "Robert Hicks" <sigzero@gmail.com>
Subject: Re: OT: O'Reilly 'Perl CD Bookshelf' - gone for good?
Message-Id: <1163783139.122060.208320@k70g2000cwa.googlegroups.com>


zentara wrote:
> On 16 Nov 2006 19:34:57 GMT, rdwillia@anon.example.net (Richard
> Williams) wrote:
>
> >Just noticed on the O'Reilly site that the 2004 4th edition of the 'Perl
> >CD Bookshelf' is out of print (as are all the other Bookshelf titles), and
> >cdbookshelves.oreilly.com is gone. I guess that means it's just Safari or
> >dead trees from now on, which seems rather a pity - the Perl CD has been
> >my main 3rd party reference since version 1, and there are several obvious
> >new candidate books for a 5th edition. Just wondering if any of the
> >O'Reilly authors here happen to know if (or why) this is indeed the end of
> >the line?
> >
> >Richard.
>
> Look for old copies at amazon.com or ebay.
> 

Yes...but we were hoping for "future" editions.

Robert



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

Date: Fri, 17 Nov 2006 09:36:37 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: Perl redirection to browser timeout ...
Message-Id: <171120060936375351%jgibson@mail.arc.nasa.gov>

In article <1163770666.727241.76890@e3g2000cwe.googlegroups.com>, JKH
<newsgroup@cleanmymailbox.com> wrote:

> I have a Perl script that is called by a web browser.  The script may
> take up to 60 seconds or more to complete processing before
> redirecting the browser to a destination URL.  The problem I'm
> experiencing is that when the processing time is between 30
> and 60 seconds, it returns a DNS error to the browser.  If
> under 30 seconds, the redirection is fine.
> 
> How can I prevent this?

This question is frequently asked here, even though it is not directly
related to Perl (the answers would be the same for any language). In
fact, it was asked yesterday - search the newsgroup for 'Avoid Apache
Timeout Per Script'.

One approach will be found here:

<http://www.stonehenge.com/merlyn/LinuxMag/col39.html>


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

Date: Fri, 17 Nov 2006 14:05:20 GMT
From: zentara <zentara@highstream.net>
Subject: Re: threads crash on XP (in Tk script)
Message-Id: <6vfrl2p8eki8ulddm6g9jebcn4l3482heq@4ax.com>

On Thu, 16 Nov 2006 23:10:46 +0000, Brian Raven
<brian.raven@osbsl.co.uk> wrote:

>"MoshiachNow" <lev.weissman@creo.com> writes:

>> Running a Tk script on my XP I always get an error.
>>
>> Code:
>> ########################################################################################
>> #use warnings;
>> use strict;
>> use Win32::OLE qw( in );
>> use Win32::Lanman;
>> use Net::Domain qw(hostname hostfqdn hostdomain);
>> use Socket 'inet_ntoa';
>> use Sys::Hostname 'hostname';
>> use Data::Validate::IP qw(is_ipv4);
>> use Net::Ping;
>> use Tk;
>> use Tk::Text;
>> use Tk::Scrollbar;
>> use Tk::Pane;
>> use threads;
>>
>> threads->create(sub { print("I am a thread\n"); })->join();
>>
>> Error:
>> I am a thread
>> Free to wrong pool 1822b00 not 222770 during global destruction.
>>
>> Any ideas?
>
>One idea would be that threads, and modules that are not thread safe
>do not mix very well. I don't know about any of the other modules that
>you use, but Tk is not thread safe.
>
>HTH

Yeah, but he has not invoked any Tk statements before he builds the
thread. It should work, and it does work fine on linux.

Tk will work fine with threads, IF you build the thread before invoking
any Tk statements, AND don't try to share objects across thread
boundaries.

But you are probably right, that one of the use statements is causing
it. I would try removing them all, and adding them back, 1 by 1, until
you find which one causes it.


-- 
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html


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

Date: 17 Nov 2006 07:02:15 -0800
From: "doolittle" <spam.meplease@ntlworld.com>
Subject: Re: what the difference between these loops?
Message-Id: <1163775734.902113.276230@b28g2000cwb.googlegroups.com>


Tad McClellan wrote:
> doolittle <spam.meplease@ntlworld.com> wrote:
> > John Bokma wrote:
> >
> >> In what way?
>
>
> In what way what?
>
> Please retain enought context for folks to be able to tell what you
> are talking about.
>

Sometimes its difficult to find a good compromise between too little,
and too much context. I have seen far more people criticized (sp?) for
including all previous posts and replies in a reply, than for not
including enough.

I think its reasonable to assume that if someone only reads the last
post in a thread, they won't get the whole story.

Yes, the perl docs are great. So is perl, because it allows people to
write useful stuff at a level of knowledge that they are comfortable
with.

I still don't understand why the 'each' loop worked when the keys were
defined one way, but not another.



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

Date: Fri, 17 Nov 2006 09:21:29 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: what the difference between these loops?
Message-Id: <171120060921290880%jgibson@mail.arc.nasa.gov>

In article <1163775734.902113.276230@b28g2000cwb.googlegroups.com>,
doolittle <spam.meplease@ntlworld.com> wrote:


> 
> I still don't understand why the 'each' loop worked when the keys were
> defined one way, but not another.
> 

If you really want to understand, then you should post a short program
that demonstrates the concept with which you are having difficulty.
There will be many here who can explain why your program behaves the
way it does.


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 V10 Issue 9976
***************************************


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