[28637] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 10001 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 24 03:05:52 2006

Date: Fri, 24 Nov 2006 00: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, 24 Nov 2006     Volume: 10 Number: 10001

Today's topics:
        Compare UNIX file time with time in a variable <phynkel@gmail.com>
    Re: Compare UNIX file time with time in a variable <spamtrap@dot-app.org>
    Re: Compare UNIX file time with time in a variable (reading news)
    Re: Do I *have* to use 'OOP' to use modules? <phaylon@dunkelheit.at>
    Re: Do I *have* to use 'OOP' to use modules? <nospam-abuse@ilyaz.org>
    Re: Do I *have* to use 'OOP' to use modules? <nospam-abuse@ilyaz.org>
    Re: Do I *have* to use 'OOP' to use modules? <abigail@abigail.be>
    Re: Embedding perl in shared libs <bastian.friedrich@collax.com>
    Re: Extracting Date using Regular Expressions <john@castleamber.com>
    Re: FAQ 6.19 What good is "\G" in a regular expression? <brian.d.foy@gmail.com>
    Re: FAQ 7.15 How do I create a static variable? <brian.d.foy@gmail.com>
    Re: Is a file in use? <m@remove.this.part.rtij.nl>
    Re: Is a file in use? <uri@stemsystems.com>
        new CPAN modules on Fri Nov 24 2006 (Randal Schwartz)
    Re: what is the best choose fork or thread? <m@remove.this.part.rtij.nl>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 23 Nov 2006 11:39:03 -0800
From: "phynkel@gmail.com" <phynkel@gmail.com>
Subject: Compare UNIX file time with time in a variable
Message-Id: <1164310743.501567.290230@f16g2000cwb.googlegroups.com>

Application: web

Background: The web page gets a string from the user and it's passed to
PERL. PERL runs a UNIX find command to find files with that string.
Then there's a lot of processing before the results are returned to the
user.

Problem: The user wants a web page option that will allow them to set
the "latest" possible date of the files that can be searched.

My idea: Get date string from user input. Use that string in a PERL
system command to "touch" a file with that date. Something like

system 'touch --date $lastdate /tmp/touchfile';

Then the PERL system command running  the find will look for files
older than "/tmp/touchfile".

I'm looking for a simpler and/or cleaner way to do things. Any
thoughts?

I don't want to make more than one pass of the files, so I want to get
everything I can out of the find command as it does some other inline
processing before getting back to PERL

TX



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

Date: Thu, 23 Nov 2006 15:12:04 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Compare UNIX file time with time in a variable
Message-Id: <m2bqmx2a97.fsf@Sherm-Pendleys-Computer.local>

"phynkel@gmail.com" <phynkel@gmail.com> writes:

> Background: The web page gets a string from the user and it's passed to
> PERL. PERL runs a UNIX find command to find files with that string.

The name of the language is Perl, not PERL.

> I'm looking for a simpler and/or cleaner way to do things. Any
> thoughts?

Have a look at File::Find. Much easier to use from within a Perl script,
and allows you to write a callback function that can use whatever criteria
you want to filter out files you're not interested in.

sherm--

-- 
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


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

Date: Thu, 23 Nov 2006 21:19:31 GMT
From: "Mumia W. (reading news)" <paduille.4060.mumia.w@earthlink.net>
Subject: Re: Compare UNIX file time with time in a variable
Message-Id: <Dfo9h.3202$1s6.1458@newsread2.news.pas.earthlink.net>

On 11/23/2006 01:39 PM, phynkel@gmail.com wrote:
> Application: web
> 
> Background: The web page gets a string from the user and it's passed to
> PERL. PERL runs a UNIX find command to find files with that string.
> Then there's a lot of processing before the results are returned to the
> user.
> 
> Problem: The user wants a web page option that will allow them to set
> the "latest" possible date of the files that can be searched.
> 
> My idea: Get date string from user input. Use that string in a PERL
> system command to "touch" a file with that date. Something like
> 
> system 'touch --date $lastdate /tmp/touchfile';
> 
> Then the PERL system command running  the find will look for files
> older than "/tmp/touchfile".
> 
> I'm looking for a simpler and/or cleaner way to do things. Any
> thoughts?
> 
> I don't want to make more than one pass of the files, so I want to get
> everything I can out of the find command as it does some other inline
> processing before getting back to PERL
> 
> TX
> 

What have you tried so far?

First, do validity checking on $lastdate before giving it to the system 
command, or you'll be sorry.

Second, I'd advise using File::Find and checking against the $lastdate 
before pushing the files onto an array (in the wanted function).


-- 
paduille.4060.mumia.w@earthlink.net


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

Date: 23 Nov 2006 23:57:39 GMT
From: Robert 'phaylon' Sedlacek <phaylon@dunkelheit.at>
Subject: Re: Do I *have* to use 'OOP' to use modules?
Message-Id: <45663573$0$18836$9b4e6d93@newsspool4.arcor-online.net>

Abigail <abigail@abigail.be> wrote
> Robert 'phaylon' Sedlacek (phaylon@dunkelheit.at) wrote on MMMMDCCCXXXI
> September MCMXCIII in <URL:news:456441c1$0$27624$9b4e6d93@newsspool2.arcor-online.net>:
> I fail to understand this argument.

Well, you've snipped an important part away:

| And in the end, it *is* just a personal opinion.

> No-one is complaining that Perl takes away flexibility by having regexes
> and hashes build in the language, or by not having pointers, but more
> restrictive references. Yet people moan that their freedom is taken away
> if Perl would have had object instance variables (aka attributes).

Because I see hashes, regexes and references as more low level than
object orientation. One is a paradigm, the others are quite simple
tools.

You might disagree, but see above.

gr.,
Robert

-- 
The eternal mistake of mankind is to set up an attainable ideal.
                        -- Aleister Crowley


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

Date: Fri, 24 Nov 2006 00:03:23 +0000 (UTC)
From:  Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Do I *have* to use 'OOP' to use modules?
Message-Id: <ek5csb$2pqk$1@agate.berkeley.edu>

[A complimentary Cc of this posting was sent to

<anno4000@radom.zrz.tu-berlin.de>], who wrote in article <4sljvnF107oaiU1@mid.dfncis.de>:
> > > > Why you think this is not applicable to the scheme above?
> > 
> > > For no particular reason except that inside-out is the only scheme I've
> > > seen yet for which it is.  It could depend on implementation details
> > > that aren't yet specified.
> > 
> > Now I'm completely confused: you say simultaneously that API is
> > sufficient, and that something depends on implementation details.  I
> > do not see how both can be true...
> 
> I understand sufficiency as "supporting the essential operations". In
> that sense even the standard hash-based attributes are sufficient.

hard to see how they can be sufficient if an object is not a hash ref...

> That doesn't imply that the implementation has all desirable properties,
> like allowing all classes conflict-free inheritance the way IOOs do.

I still do not see where conflicts can come from.  With this API, an
"attribute" is just a pair of methods, setter and getter.  So
inheritance is always conflict-free.

Hope this helps,
Ilya


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

Date: Fri, 24 Nov 2006 00:14:31 +0000 (UTC)
From:  Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Do I *have* to use 'OOP' to use modules?
Message-Id: <ek5dh7$2q7l$1@agate.berkeley.edu>

[A complimentary Cc of this posting was sent to
Abigail 
<abigail@abigail.be>], who wrote in article <slrnem7rcb.c8.abigail@alexandra.abigail.be>:
> But I do think that
> 
>     $val = $.a_name;
> 
> (to borrow a Perl6 syntax) is vastly superiour over either
> 
>     $val = $self -> __get_a_name;
> 
> and
> 
>     $val = $$self {a_name};

Do I understand correct that you agree on having the same namespace
for attributes and methods?  In my example API I put a special
emphasis to have them in separate namespaces...  It would be greatly
simplified if the namespaces should be merged:

   # Create methods accessing slots in out-of-band storage of the object
   use OO::attrib qw(foo bar baz);     # In the class' package

   $val = $o->baz;
   $o->baz = $val;		# If lvalue is allowed
   $o->baz__set($val);		# If performance of getter is tantamount

Then I cannot interpret your objections in other way than saying that
$o.baz is "vastly superiour" to $o->baz...

Puzzled,
Ilya

P.S.    Recall that Abigail insisted that attributes should be present
        in the core, and I fail to see why this should not be delegated
        to a module.

P.P.S.  Hmm, an XSUB accessor could easily allow lvalue methods
	without a noticable overhead.  Probably, some of my old
	patches could simplify development a lot, but even without
	them, XSUB accessors are possible.


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

Date: 24 Nov 2006 00:50:37 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: Do I *have* to use 'OOP' to use modules?
Message-Id: <slrnemcgdn.c8.abigail@alexandra.abigail.be>

Ilya Zakharevich (nospam-abuse@ilyaz.org) wrote on MMMMDCCCXXXIII
September MCMXCIII in <URL:news:ek5dh7$2q7l$1@agate.berkeley.edu>:
__  [A complimentary Cc of this posting was sent to
__  Abigail 
__ <abigail@abigail.be>], who wrote in article <slrnem7rcb.c8.abigail@alexandra.abigail.be>:
__ > But I do think that
__ > 
__ >     $val = $.a_name;
__ > 
__ > (to borrow a Perl6 syntax) is vastly superiour over either
__ > 
__ >     $val = $self -> __get_a_name;
__ > 
__ > and
__ > 
__ >     $val = $$self {a_name};
__  
__  Do I understand correct that you agree on having the same namespace
__  for attributes and methods?

You understand incorrectly. Attributes should be private to the class;
an object may have more than one attribute with the same name, but no
class could have more than one attribute with the same name.

Each class decides for itself whether it will provide an accessor 
for an attribute.

__                               In my example API I put a special
__  emphasis to have them in separate namespaces...  It would be greatly
__  simplified if the namespaces should be merged:


If your API was supposed to put any emphasis on namespaces, it was
completely lost to me.


__     # Create methods accessing slots in out-of-band storage of the object
__     use OO::attrib qw(foo bar baz);     # In the class' package
__  
__     $val = $o->baz;
__     $o->baz = $val;		# If lvalue is allowed
__     $o->baz__set($val);		# If performance of getter is tantamount
__  
__  Then I cannot interpret your objections in other way than saying that
__  $o.baz is "vastly superiour" to $o->baz...

I may not want to expose the existance (or non-existance) of an attribute
to the world at large. Furthermore, if we would have Perl6 style attributes,
we would have compile time checking of typos in attribute names; methods
aren't resolved until runtime.

__  P.S.    Recall that Abigail insisted that attributes should be present
__          in the core, and I fail to see why this should not be delegated
__          to a module.

I couldn't give a rats ass whether it's core or a module. What I care about
is:

    *  Encapsulation. How one class is implemented should neither depend
       on the implementation of a superclass, nor restrict the implementation
       of a subclass.
    *  Compile time checking of my attribute names. Full advantage of
       'use strict'.
    *  A syntax that isn't convoluted. Attributes are variables - they should
       look like variables. Methods don't look like variables.



Abigail
-- 
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
 |perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
 |perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
 |perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;


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

Date: Fri, 24 Nov 2006 09:00:12 +0100
From: Bastian Friedrich <bastian.friedrich@collax.com>
Subject: Re: Embedding perl in shared libs
Message-Id: <4566a68d$0$27622$9b4e6d93@newsspool2.arcor-online.net>

Hi Ben,

thx a lot for your detailed explanation.

Ben Morrow wrote:

>> So my questions are:
>> * Is this behaviour "normal"? Is RTLD_GLOBAL in fact absolutely necessary
>> in
>>   that place?
> 
> It seems pretty clear to me from dlopen(3):

I had read man dlopen, even more then once. Frankly, I had not fully
understood it (and probably still have not)...

> | Optionally,  RTLD_GLOBAL  may  be  or'ed  into  flag, in which case the
> | external symbols defined in the library will be made available for sym-
> | bol  resolution  of  subsequently  loaded  libraries.
> 
> That is, unless you use RTLD_GLOBAL, the symbols from -lperl (which were
> pulled in either from or by libB.so, depending on whether libB is
> statically or dynamically linked to libperl) won't be available to the
> dynamically loaded extensions later. Since they require those symbols,
> you get a segfault.

Program A does not need access to Perl's symbols. That's why I thought
RTLD_GLOBAL might in fact not be necessary. Obviously, I misunderstood the
GLOBAL flag.

>> * Did I really hit a perl bug??
> 
> Nope.

Good. ;)

>> * Do you know about any workarounds?
> 
> Use RTLD_GLOBAL. Is this a problem?

In a way. I'm not writing/maintaining the core program, I just develop a
module for it. Unfortunately, a second (standard) module segfaults when
loaded with RTLD_GLOBAL. If I want to load all modules with the same flags,
I only had the choice between a segfaulting perl and a segfaulting standard
module.

Currently, I introduced a configuration flag that lets users modify the
loading behaviour. By this, my perlish module may be loaded /with/
RTLD_GLOBAL, while others are not. We will see whether I'll stick with
that...

Anyway, I now have an answer to the core question "do I really need
RTLD_GLOBAL". Thx again!

   Bastian



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

Date: 23 Nov 2006 20:46:38 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: Extracting Date using Regular Expressions
Message-Id: <Xns98849651AD17Dcastleamber@130.133.1.4>

Sherm Pendley <spamtrap@dot-app.org> wrote:

> John & David probably already knew all that

I probably would find it out  when it would happen to me, and be able to 
clarify it afterwards, so thanks for preventing me wasting time :-)

http://johnbokma.com/mexit/2005/05/18/

I will add a link to your post, thanks.

-- 
John                Experienced Perl programmer: http://castleamber.com/

          Perl help, tutorials, and examples: http://johnbokma.com/perl/


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

Date: Thu, 23 Nov 2006 12:11:56 -0800
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 6.19 What good is "\G" in a regular expression?
Message-Id: <231120061211566890%brian.d.foy@gmail.com>

In article <ek31rh.16o.1@news.isolution.nl>, Dr.Ruud
<rvtol+news@isolution.nl> wrote:

> Darren Dunham schreef:
> > Dr.Ruud:
> 
> >> Where is the c-flag (or should it be called the c-modifier)
> >> documented?
> >
> > perlop and perlreref both describe those flags.
> 
> Yes, I keep wondering why it isn't described in perlre. 

Me too. Somewhere on my TO DO list I've now added a rewrite of perlre.
Despite the excellent comments already mentioned about modifying the
expression versus modifying the operation, the user really just wants
to see all the RE stuff perlre. :)

-- 
Posted via a free Usenet account from http://www.teranews.com



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

Date: Thu, 23 Nov 2006 12:20:39 -0800
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 7.15 How do I create a static variable?
Message-Id: <231120061220398274%brian.d.foy@gmail.com>

In article <tbmoore9-B7B67F.21460022112006@news.verizon.net>, boyd
<tbmoore9@verizon.net> wrote:

> oops - I think brian meant:
> 
> BEGIN{
>     my $count = 1;
>     sub counter { $count++ }
> }
> 
> my $start = counter();  

Ah, rats, you're right. I've fixed that in the sources now, even though
it took me a bit of staring at it to see my mistake. :)

-- 
Posted via a free Usenet account from http://www.teranews.com



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

Date: Thu, 23 Nov 2006 21:40:44 +0100
From: Martijn Lievaart <m@remove.this.part.rtij.nl>
Subject: Re: Is a file in use?
Message-Id: <pan.2006.11.23.20.40.44.428054@remove.this.part.rtij.nl>

On Thu, 23 Nov 2006 01:49:40 -0800, Stevie wrote:

> Would it be better/faster to try to open the file?
> Any suggestions gratefully received.

In all processes accessing the file, lock it first.

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



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

Date: Thu, 23 Nov 2006 23:18:46 -0500
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Is a file in use?
Message-Id: <x7ac2h8ok9.fsf@mail.sysarch.com>

>>>>> "S" == Stevie  <steviehaston@hotmail.com> writes:

  S> Thanks for your response. In my case the files in question aren't going
  S> to become in use, they will become not in use. They are being written
  S> to by another process, which, once its completed writing the files,
  S> doesn't touch them again.

that smells of an XY problem. you are stuck on this lsof type solution
when i suspect the problem is higher up and probably easier to solve.

is this a case of polling to see if a file is new or completely written?
there are better ways to deal with that than lsof.

so why don't you describe the bigger problem instead of the troubles you
are having with your chosen solution?

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: Fri, 24 Nov 2006 05:42:11 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Fri Nov 24 2006
Message-Id: <J97zuB.LFv@zorch.sf-bay.org>

The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN).  You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.

Acme-DarmstadtPM-TieHash-0.1
http://search.cpan.org/~reneeb/Acme-DarmstadtPM-TieHash-0.1/
----
Acme-DarmstadtPM-TieHash-0.2
http://search.cpan.org/~reneeb/Acme-DarmstadtPM-TieHash-0.2/
a module that shows that Perl can do all the Ruby things ;-)
----
Apache-WebDAV-0.01
http://search.cpan.org/~lozier/Apache-WebDAV-0.01/
Extensible WebDAV server for Apache.
----
BSD-setproctitle-0.01
http://search.cpan.org/~mkamm/BSD-setproctitle-0.01/
Perl interface to BSD's setprogname(3) and setproctitle(3)
----
CGI-FormBuilder-Template-HTC-0.02
http://search.cpan.org/~tinita/CGI-FormBuilder-Template-HTC-0.02/
----
Catalyst-Plugin-Authentication-Credential-BBAuth-0.03
http://search.cpan.org/~jiro/Catalyst-Plugin-Authentication-Credential-BBAuth-0.03/
Yahoo! Browser-Based Authentication for Catalyst.
----
Class-XML-Parser-0.9.01
http://search.cpan.org/~mmorgan/Class-XML-Parser-0.9.01/
Parses (and optionally validates against a DTD) an XML message into a user-defined class structure.
----
Class-XML-Parser-0.901
http://search.cpan.org/~mmorgan/Class-XML-Parser-0.901/
Parses (and optionally validates against a DTD) an XML message into a user-defined class structure.
----
DBD-TimesTen-0.02
http://search.cpan.org/~wagnerch/DBD-TimesTen-0.02/
TimesTen Driver for DBI
----
Danga-Socket-1.55
http://search.cpan.org/~bradfitz/Danga-Socket-1.55/
Event loop and event-driven async socket base class
----
DateTime-Format-Natural-EN-0.11
http://search.cpan.org/~schubiger/DateTime-Format-Natural-EN-0.11/
Create machine readable date/time with natural parsing logic
----
Geo-Coder-Ja-0.03
http://search.cpan.org/~jiro/Geo-Coder-Ja-0.03/
geocoder.ja library module for Perl
----
Ingres-Utility-Netutil-0.03
http://search.cpan.org/~worm/Ingres-Utility-Netutil-0.03/
API to netutil Ingres RDBMS utility
----
Jifty-0.61123_01
http://search.cpan.org/~jesse/Jifty-0.61123_01/
an application framework
----
Jifty-DBI-0.29
http://search.cpan.org/~jesse/Jifty-DBI-0.29/
An object-relational persistence framework
----
Kwalify-1.07
http://search.cpan.org/~srezic/Kwalify-1.07/
Kwalify schema for data structures
----
Lingua-EN-NameParse-1.23
http://search.cpan.org/~kimryan/Lingua-EN-NameParse-1.23/
routines for manipulating a person's name
----
Net-GPSD-Server-Fake-0.06
http://search.cpan.org/~mrdvt/Net-GPSD-Server-Fake-0.06/
Provides a Fake GPSD daemon server test harness.
----
Net-GPSD-Server-Fake-0.07
http://search.cpan.org/~mrdvt/Net-GPSD-Server-Fake-0.07/
Provides a Fake GPSD daemon server test harness.
----
Net-Packet-3.23
http://search.cpan.org/~gomor/Net-Packet-3.23/
a framework to easily send and receive frames from layer 2 to layer 7
----
Net-Packet-Shell-0.21
http://search.cpan.org/~gomor/Net-Packet-Shell-0.21/
Scapy like implementation using Net::Packet, just to prove it
----
Objects-Collection-0.29
http://search.cpan.org/~zag/Objects-Collection-0.29/
abstract class for collections of data.
----
Objects-Collection-0.30
http://search.cpan.org/~zag/Objects-Collection-0.30/
abstract class for collections of data.
----
POE-Component-Client-Whois-1.08
http://search.cpan.org/~bingos/POE-Component-Client-Whois-1.08/
A one shot non-blocking RFC 812 WHOIS query.
----
Test-CheckManifest-0.7
http://search.cpan.org/~reneeb/Test-CheckManifest-0.7/
Check if your Manifest matches your distro
----
URI-ParseSearchString-0.10
http://search.cpan.org/~sden/URI-ParseSearchString-0.10/
parse Apache refferer logs and extract search engine query strings.
----
URI-ParseSearchString-1.0
http://search.cpan.org/~sden/URI-ParseSearchString-1.0/
parse Apache refferer logs and extract search engine query strings.
----
WWW-Mixi-0.48
http://search.cpan.org/~tsukamoto/WWW-Mixi-0.48/
Perl extension for scraping the MIXI social networking service.
----
WebService-TWFY-API-0.01
http://search.cpan.org/~sden/WebService-TWFY-API-0.01/
API interface for TheyWorkForYou.com
----
XML-DT-0.47
http://search.cpan.org/~ambs/XML-DT-0.47/
a package for down translation of XML files
----
autobox-1.10
http://search.cpan.org/~chocolate/autobox-1.10/
use builtin datatypes as first-class objects
----
bioperl-1.5.2_005-RC
http://search.cpan.org/~sendu/bioperl-1.5.2_005-RC/
----
bioperl-1.5.2_005-RCb
http://search.cpan.org/~sendu/bioperl-1.5.2_005-RCb/
----
bioperl-db-1.5.2_005-RC
http://search.cpan.org/~sendu/bioperl-db-1.5.2_005-RC/
----
bioperl-network-1.5.2_005-RC
http://search.cpan.org/~sendu/bioperl-network-1.5.2_005-RC/
----
bioperl-run-1.5.2_005-RC
http://search.cpan.org/~sendu/bioperl-run-1.5.2_005-RC/
----
dirtyRSS-0.3
http://search.cpan.org/~billauer/dirtyRSS-0.3/
A dirty but self-contained RSS parser
----
dotReader-v0.0.7
http://search.cpan.org/~ewilhelm/dotReader-v0.0.7/
----
vptk-2.24
http://search.cpan.org/~felixl/vptk-2.24/
Perl/Tk Visual resource editor (canvas edition)


If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.

This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
  http://www.stonehenge.com/merlyn/LinuxMag/col82.html

print "Just another Perl hacker," # the original

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Thu, 23 Nov 2006 21:36:52 +0100
From: Martijn Lievaart <m@remove.this.part.rtij.nl>
Subject: Re: what is the best choose fork or thread?
Message-Id: <pan.2006.11.23.20.36.52.31893@remove.this.part.rtij.nl>

On Thu, 23 Nov 2006 23:56:42 +0800, sonet wrote:

> I have a project must send a lot of file in win2k at the same time.
> But what is the best method in win32?
> Can the perl build-in function fork work in win32?
> Or the perl build-in thread is good solution

Besides Anno's answer, be aware that threads have severe limitations. More
to the point, threads and signals don't mix. So if you need timeouts (in
Perl) or any other signal handling, you are pretty much stuck on forking.

Other than that, in general threads are faster than forks. New threads are
created faster and interthread/process communication is generally faster.
However on Windows, forks are implemented as threads (according to Anno)
so the equation may be different on Windows.

Now you say that this is about "a lot of file". Do you mean transfers of
big files? In that case the transfer time is likely to swamp any
difference between threads and forks, as long as the threads/processes
don't need to communicate much.

The best answer may be to try it out.

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



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

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


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