[28636] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 10000 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 23 14:06:04 2006

Date: Thu, 23 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           Thu, 23 Nov 2006     Volume: 10 Number: 10000

Today's topics:
    Re: Do I *have* to use 'OOP' to use modules? anno4000@radom.zrz.tu-berlin.de
    Re: DOS-Box script is running in set always on top <nimmerman@gmx.de>
    Re: Extracting Date using Regular Expressions <mritty@gmail.com>
    Re: Extracting Date using Regular Expressions <tbmoore9@verizon.net>
    Re: Extracting Date using Regular Expressions <David.Squire@no.spam.from.here.au>
    Re: Extracting Date using Regular Expressions <spamtrap@dot-app.org>
    Re: FAQ 6.19 What good is "\G" in a regular expression? <parv_@yahooWhereElse.com>
    Re: FAQ 6.19 What good is "\G" in a regular expression? <rvtol+news@isolution.nl>
    Re: FAQ 6.19 What good is "\G" in a regular expression? <rvtol+news@isolution.nl>
    Re: FAQ 6.19 What good is "\G" in a regular expression? (reading news)
    Re: File open problem <someone@example.com>
    Re: How to read the Doctype Information out of an XML F pod69@gmx.net
    Re: How to read the Doctype Information out of an XML F <DJStunks@gmail.com>
    Re: Is a file in use? <steviehaston@hotmail.com>
    Re: Is a file in use? <vilain@spamcop.net>
    Re: Is a file in use? <steviehaston@hotmail.com>
    Re: Is a file in use? <georgekinley@hotmail.com>
    Re: Is a file in use? <spamtrap@dot-app.org>
        what is the best choose fork or thread? <sonet.all@msa.hinet.net>
    Re: what is the best choose fork or thread? anno4000@radom.zrz.tu-berlin.de
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 23 Nov 2006 12:54:15 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: Do I *have* to use 'OOP' to use modules?
Message-Id: <4sljvnF107oaiU1@mid.dfncis.de>

Ilya Zakharevich  <nospam-abuse@ilyaz.org> wrote in comp.lang.perl.misc:
> [A complimentary Cc of this posting was sent to
> 
> <anno4000@radom.zrz.tu-berlin.de>], who wrote in article
> <4sjmb8F107nueU2@mid.dfncis.de>:
> > > > To answer your question from the parent posting, "Why not do it this
> > > > way" I'd first have to see how well the scheme works in practice.
> 
> > > Hmm, I hoped that somebody *knows* what an attribute *is*, so is able
> > > to see whether the API is sufficient...
> 
> > I don't doubt its sufficiency (though an lvalue accessor might be
> > added).  Like Abigail I see potential problems in usability.
> 
> > > 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.
That doesn't imply that the implementation has all desirable properties,
like allowing all classes conflict-free inheritance the way IOOs do.

Anno


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

Date: 23 Nov 2006 07:55:59 -0800
From: "Daniel Kelber" <nimmerman@gmx.de>
Subject: Re: DOS-Box script is running in set always on top
Message-Id: <1164297358.942588.278750@j72g2000cwa.googlegroups.com>

Robert May schrieb:

> The GetConsoleWindow function retrieves the window handle used by the
> console associated with the calling process.
>
>       HWND GetConsoleWindow(void);

Hi Rob,
this works very well! Thanks.

Here the resulting code:

#!/usr/bin/perl -w

use strict;
use Win32::API;

my %wFlag = ( HWND_TOP       =>  0,
              HWND_BOTTOM    =>  1,
              HWND_TOPMOST   => -1,
              HWND_NOTOPMOST => -2,
              SWP_NOSIZE     =>  1,
              SWP_NOMOVE     =>  2,
              SWP_NOZORDER   =>  4,
              SWP_NOREDRAW   =>  8,
              SWP_NOACTIVATE => 16,
              SWP_SHOWWINDOW => 64 );


my $GetConsoleWindow = new Win32::API('kernel32', 'GetConsoleWindow',
                                                  [],'N');
my $SetWindowPos     = new Win32::API('user32',   "SetWindowPos",
                                                  'NNNNNNN', 'N');

if (defined($GetConsoleWindow) and defined($SetWindowPos)) {
  my $windowHandle = $GetConsoleWindow->Call();

  $SetWindowPos->Call($windowHandle,$wFlag{HWND_TOPMOST},0,0,0,0,
                       $wFlag{SWP_NOSIZE} | $wFlag{SWP_NOMOVE} )
                                                 if($windowHandle);
}

Daniel



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

Date: 23 Nov 2006 03:44:48 -0800
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Extracting Date using Regular Expressions
Message-Id: <1164282288.101910.251380@f16g2000cwb.googlegroups.com>

Kimi wrote:
> Paul Lalli wrote:
> > Or, if you didn't feel like doing all that work yourself, take
> > advantage of modules on CPAN, like Date::Manip...

> Thanks Paul for your help, I tried running the script in my PC, but it
> says "Can't locate Date/Manip.pm in @INC (@INC contains:

Like I said, it's a module found on CPAN, not included in the core
distrobution.  If you don't know what CPAN is, please read:
perldoc -q cpan
perldoc perlmodinstall

Paul Lallli



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

Date: Thu, 23 Nov 2006 12:45:23 GMT
From: boyd <tbmoore9@verizon.net>
Subject: Re: Extracting Date using Regular Expressions
Message-Id: <tbmoore9-697A4C.07452223112006@news.verizon.net>

In article <1164258158.819241.154360@b28g2000cwb.googlegroups.com>,
 "Kimi" <shafa.fahad@gmail.com> wrote:


> 
> Thanks Paul for your help, I tried running the script in my PC, but it
> says "Can't locate Date/Manip.pm in @INC (@INC contains:
> /System/Library/Perl/5.8.6/darwin-thread-multi-2level
> /System/Library/Perl/5.8.6
> /Library/Perl/5.8.6/darwin-thread-multi-2level /Library/Perl/5.8.6
> /Library/Perl /Network/Library/Perl/5.8.6/darwin-thread-multi-2level
> /Network/Library/Perl/5.8.6 /Network/Library/Perl
> /System/Library/Perl/Extras/5.8.6/darwin-thread-multi-2level
> /System/Library/Perl/Extras/5.8.6 /Library/Perl/5.8.1 .) at datefind
> line 4.
> BEGIN failed--compilation aborted at datefind line 4."
> 
> So the system couldn't find manip.pm. Currently i am using 5.8.6 in mac
> OS X. Would appreciate your help if I can get to know what could be the
> solution for it...
> 
> Thanks in advance,
> Kimi

You need to install the module from CPAN. Setting up the cpan command 
takes some effort, but it is worth it because it opens up access to 
about 8000 modules that are very helpful and powerful.  Once it is set 
up, you can just issue the command install Date::Manip, and it will do 
it.  It will also install any missing prerequisite modules.

The following site is helpful, I think.  It includes a Mac OS X section 
as well.

http://sial.org/howto/perl/life-with-cpan/

Boyd


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

Date: Thu, 23 Nov 2006 14:44:18 +0000
From: David Squire <David.Squire@no.spam.from.here.au>
Subject: Re: Extracting Date using Regular Expressions
Message-Id: <ek4c42$lgn$1@gemini.csx.cam.ac.uk>

John Bokma wrote:
> "Kimi" <shafa.fahad@gmail.com> wrote:
> 
> 
>> Thanks Paul for your help, I tried running the script in my PC, but it
>> says "Can't locate Date/Manip.pm in @INC (@INC contains:
> 
> Install it via CPAN.
> 
>> So the system couldn't find manip.pm.
> 
> No, it couldn't find Date/Manip.pm
> 
> Also notice that your OS is CaSe SeNSitIVe.
> 

Actually, the OP says he using using Mac OS X, which SomeTimes Is, and
sometimes isn't. Grrr.


DS


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

Date: Thu, 23 Nov 2006 11:46:58 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Extracting Date using Regular Expressions
Message-Id: <m2fyca156l.fsf@Sherm-Pendleys-Computer.local>

David Squire <David.Squire@no.spam.from.here.au> writes:

> John Bokma wrote:
>> "Kimi" <shafa.fahad@gmail.com> wrote:
>> 
>> 
>>> Thanks Paul for your help, I tried running the script in my PC, but it
>>> says "Can't locate Date/Manip.pm in @INC (@INC contains:
>> 
>> Install it via CPAN.
>> 
>>> So the system couldn't find manip.pm.
>> 
>> No, it couldn't find Date/Manip.pm
>> 
>> Also notice that your OS is CaSe SeNSitIVe.
>> 
>
> Actually, the OP says he using using Mac OS X, which SomeTimes Is, and
> sometimes isn't. Grrr.

It's a moot point anyway, because Perl is case sensitive even when the file
system isn't. So Perl will be able to find the correct file and read it, but
won't import() its function, because it'll be looking for date::manip::import
instead of Date::Manip::import.

For example:

    #!/usr/bin/perl

    use warnings;
    use strict;

    use date::manip;

This *appears* to run correctly, with no error messages, because the import()
function is optional. But Date::Manip is a non-OO module, and would normally
export a number of functions. So adding a call to one of those functions will
fail, as shown:

    print DateManipVersion(), "\n";

Produces the following:

    /Users/sherm/testdm.pl:8:  Undefined subroutine &main::DateManipVersion
    called

John & David probably already knew all that - I wanted to mention it for the
record, because the errors that case-insensitive file systems can produce are
not always of the obvious "Can't locate foo/bar.pm" variety.

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 02:35:24 -0600
From: parv <parv_@yahooWhereElse.com>
Subject: Re: FAQ 6.19 What good is "\G" in a regular expression?
Message-Id: <slrnemanaf.ass.parv_@localhost.holy.cow>

in message <221120061841430249%brian.d.foy@gmail.com>,
wrote brian d foy ...

><rvtol+news@isolution.nl> wrote:
>> Where is the c-flag (or should it be called the c-modifier) documented?
>
> I also added a reference to perlop and perlreref.

Thank you.


  - parv

-- 
As nice it is to receive personal mail, too much sweetness causes
tooth decay.  Unless you have burning desire to contact me, do not do
away w/ WhereElse in the address for private communication.



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

Date: Thu, 23 Nov 2006 11:01:29 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: FAQ 6.19 What good is "\G" in a regular expression?
Message-Id: <ek3v6m.1hc.1@news.isolution.nl>

Ben Morrow schreef:
> Dr.Ruud:
>> Darren Dunham:
>>> 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.
>
> I guess the reason is that /imsx modify the pattern (which is why they
> appear in stringified qr//), whereas /cgo modify the matching
> operation.

Yes, but because the "/g" modifier and the "\G" assertion and "pos()"
are played in perlre, "pos()" even as lvalue, I feel that the "/c"
modifier should at least be mentioned once were "\G" and "pos()" appear,
maybe something like
"When "/g" and "/c" are used together, pos is not reset on a failed
match; see perlop.".

I don't mind it that the "/o" modifier is not mentioned, because most of
its usages are now "obsolete". Only the "freeze" effect is still
special, so "o" for "obdurate/occluded/omen/one-off/oner/organic/oyster"
(hey, it's december, meaning-month).
"With "/o", the pattern can be compiled only once. A pattern without the
"/o" modifier will often also be compiled only once, but can get
compiled more than once, for instance when a variable is changed that is
part of the pattern."

-- 
Affijn, Ruud

"Gewoon is een tijger."



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

Date: Thu, 23 Nov 2006 11:02:35 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: FAQ 6.19 What good is "\G" in a regular expression?
Message-Id: <ek3v6n.1hc.1@news.isolution.nl>

brian d foy schreef:
> In article <ek1b8j.k0.1@news.isolution.nl>, Dr.Ruud
> <rvtol+news@isolution.nl> wrote:
>
>> PerlFAQ Server schreef:
>
>>>     Suppose you want to match all of consective pairs of digits in a
>
>> consecutive
>
>>>     pos()) even if a match on the same string as failed in the
>
>> has failed
>
> I've fixed the spelling errors. Thanks,
>
>> Where is the c-flag (or should it be called the c-modifier)
>> documented?
>
> I also added a reference to perlop and perlreref.

OK, thanks.

-- 
Affijn, Ruud

"Gewoon is een tijger."



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

Date: Thu, 23 Nov 2006 10:33:25 GMT
From: "Mumia W. (reading news)" <paduille.4060.mumia.w@earthlink.net>
Subject: Re: FAQ 6.19 What good is "\G" in a regular expression?
Message-Id: <VNe9h.2344$ql2.859@newsread3.news.pas.earthlink.net>

On 11/22/2006 08:41 PM, brian d foy wrote:
> In article <ek1b8j.k0.1@news.isolution.nl>, Dr.Ruud
> <rvtol+news@isolution.nl> wrote:
> 
>> PerlFAQ Server schreef:
>>> Suppose you want to match all of consective pairs of digits in a 
>>> consecutive 
>>> pos()) even if a match on the same string as failed in the 
>>> has failed
> 
> I've fixed the spelling errors. Thanks,
> 
>> Where is the c-flag (or should it be called the c-modifier) documented?
> 
> I also added a reference to perlop and perlreref.
> 


Thanks for maintaining the Perl FAQs Brian.


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



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

Date: Thu, 23 Nov 2006 12:38:24 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: File open problem
Message-Id: <4Dg9h.145$p9.45@edtnps82>

IJALAB wrote:
> 
> I am trying to take the files as command line arguments and do some
> formatting to the files based on their extensions. I am getting error
> in the file open when i use $ARGV[$i]
> Also, I am assigning a fixed name to my files. can i dynamically do
> them based on my input file names?

To add to Dan's and Keith's comments.


> print $#ARGV;
> $copypath = "<path>";
> for ($i=0;$i<=$#ARGV;$i= $i + 1)
> {
> 
> $b0 = system("copy $ARGV[$i] $copypath\\scripts");
> $b1 = chdir ("$copypath\\scripts");
> $extn = substr($ARGV[$i],-4,4);
> print $extn, "\n";
> print $ARGV[$i];
> $file = $ARGV[$i];
> if ($extn == ".txt")

You are using a numerical comparison operator so the strings will be converted
to numbers, and unless either string begins with numerical digits they will
both be converted to 0, so that test will almost always be true no matter what
$extn contains.  Also Windows file names are case insensitive so you need to
do something like this:

if ( lc( $extn ) eq '.txt' )

Or:

if ( $extn =~ /\.txt\z/i )


> {
> 

[ snip ]

> }
> 
> elsif ($extn == ".csv")

Same as above.




John
-- 
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order.       -- Larry Wall


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

Date: 23 Nov 2006 00:54:06 -0800
From: pod69@gmx.net
Subject: Re: How to read the Doctype Information out of an XML File
Message-Id: <1164272046.389441.58540@h54g2000cwb.googlegroups.com>

Hello,
Do you have an example somewhere so i can see how it looks like because
i dont know what to do or do you have some code?
thx


DJ Stunks schrieb:

> pod69@gmx.net wrote:
> > Hello,
> >
> > How can i read the Doctype Information out of an xml file?
> >
> > <!DOCTYPE foo SYSTEM "foo.dtd"
> >       [
> >       <!ENTITY bla SYSTEM "bla.xml">
> >       <!ENTITY foofoo SYSTEM "foofoo.xml">
> >  ]
> >
> > So that i get out e.g. in an array bla.xml and foofoo.xml?
>
> I would use XML::Parser and write an Entity handler which pushed the
> Sysid onto a globally scoped array.  After it has parsed the whole file
> your array will contain your entities.
> 
> -jp



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

Date: 23 Nov 2006 10:11:40 -0800
From: "DJ Stunks" <DJStunks@gmail.com>
Subject: Re: How to read the Doctype Information out of an XML File
Message-Id: <1164305500.735181.325570@k70g2000cwa.googlegroups.com>

pod69@gmx.net wrote:
> DJ Stunks schrieb:
> > pod69@gmx.net wrote:
> > > Hello,
> > >
> > > How can i read the Doctype Information out of an xml file?
> >
> > I would use XML::Parser and write an Entity handler which pushed the
> > Sysid onto a globally scoped array.  After it has parsed the whole file
> > your array will contain your entities.
>
> Do you have an example somewhere so i can see how it looks like because
> i dont know what to do or do you have some code?

[ please don't top post!  quote an appropriate amount of context and
then post your reply underneath]

I thought my answer was pretty clear; if you're having a hard time
understanding it then I suspect you will have a hard time completing
your task.  However, since I was curious I whipped this up.

Enjoy!

-jp

  #!/usr/bin/perl

  use strict;
  use warnings;

  use XML::Parser;

  my $xml = do{ local $/; <DATA> };

  my $parser
  	= new XML::Parser(Handlers => { Entity => \&handle_entity });

  my @entities;
  $parser->parse( $xml );

  print "Entities:\n";
  print "  $_\n" for @entities;

  sub handle_entity {
  	@_{ qw(Expat Name Val Sysid Pubid Ndata IsParam) } = @_;

  	push @entities, $_{Sysid};

  }

  __DATA__
  <!-- xq226.xml -->
  <!DOCTYPE poem [
  <!ENTITY ext1 SYSTEM "lines938-939.xml">
  ]>
  <poem>
  <verse>I therefore, I alone first undertook</verse>
  <verse>To wing the desolate Abyss, and spy</verse>
  &ext1;
  <verse>Better abode, and my afflicted Powers</verse>
  <verse>To settle here on Earth or in mid-air</verse>
  </poem>



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

Date: 23 Nov 2006 01:49:40 -0800
From: "Stevie" <steviehaston@hotmail.com>
Subject: Re: Is a file in use?
Message-Id: <1164275380.052447.311370@j72g2000cwa.googlegroups.com>

OK, Understood your points about portability but thats not an issue
here. I'm running linux and my main concern is to ensure the code
executes as fast as possible. The reason I'm checking for it being
locked is to make sure that it is not being written to by another
process.

Current code is:

system("lsof $file");
if ( $? == 0 ) {
   print " success - not locked, exit status = $?\n";
} else {
   print " failure - locked, exit status = $?\n";
}

This always returns failure with a exit status of 256. Any ideas why?

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



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

Date: Thu, 23 Nov 2006 02:50:12 -0800
From: Michael Vilain <vilain@spamcop.net>
Subject: Re: Is a file in use?
Message-Id: <vilain-6E1EB4.02501223112006@comcast.dca.giganews.com>

In article <1164275380.052447.311370@j72g2000cwa.googlegroups.com>,
 "Stevie" <steviehaston@hotmail.com> wrote:

> OK, Understood your points about portability but thats not an issue
> here. I'm running linux and my main concern is to ensure the code
> executes as fast as possible. The reason I'm checking for it being
> locked is to make sure that it is not being written to by another
> process.
> 
> Current code is:
> 
> system("lsof $file");
> if ( $? == 0 ) {
>    print " success - not locked, exit status = $?\n";
> } else {
>    print " failure - locked, exit status = $?\n";
> }
> 
> This always returns failure with a exit status of 256. Any ideas why?
> 
> Would it be better/faster to try to open the file?
> Any suggestions gratefully received.
> Stevie

This isn't guaranteed to because the time between the completion of the 
system() and the next line could have something open the file.  What 
this boils down to is that there's no real way in the OS to guarantee a 
file isn't being written when you open it.  UNIX will just let you do it 
unless the program that's opening the file takes out a lock on it.  The 
OS won't do that for you.

Rethink your approach.  It won't work.

-- 
DeeDee, don't press that button!  DeeDee!  NO!  Dee...





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

Date: 23 Nov 2006 03:15:44 -0800
From: "Stevie" <steviehaston@hotmail.com>
Subject: Re: Is a file in use?
Message-Id: <1164280544.332177.83270@m7g2000cwm.googlegroups.com>

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

I worked out what I was doing wrong (and reading the perldoc -f system
might have helped).

Placing the command in backticks allows you to capture the output. FWIW
test harness follows:

use strict;
use warnings;
use Data::Dumper;

my @ret = `lsof pathtomyfile`;
if (@ret) {
        print Dumper \@ret;
        print "File is in use, num of lines in output from lsof is
".scalar(@ret)."\n";
} else {
        print "Not in use\n";
}

Job done.



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

Date: Thu, 23 Nov 2006 16:13:50 GMT
From: "George" <georgekinley@hotmail.com>
Subject: Re: Is a file in use?
Message-Id: <2Nj9h.43638$_k2.797787@news2.nokia.com>


"Stevie" <steviehaston@hotmail.com> wrote in message 
news:1164275380.052447.311370@j72g2000cwa.googlegroups.com...
> OK, Understood your points about portability but thats not an issue
> here. I'm running linux and my main concern is to ensure the code
> executes as fast as possible. The reason I'm checking for it being
> locked is to make sure that it is not being written to by another
> process.
>
> Current code is:
>
> system("lsof $file");
> if ( $? == 0 ) {
>   print " success - not locked, exit status = $?\n";
> } else {
>   print " failure - locked, exit status = $?\n";
> }
>
> This always returns failure with a exit status of 256. Any ideas why?
>
> Would it be better/faster to try to open the file?
> Any suggestions gratefully received.
> Stevie
>

An old internet joke:

A:  because it messes up threading
Q:  why would I not reply by top-posting?
This joke succinctly illustrates the problems with top-posting: you see the 
answer before you see the question.




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

Date: Thu, 23 Nov 2006 11:24:39 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Is a file in use?
Message-Id: <m2k61m167s.fsf@Sherm-Pendleys-Computer.local>

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

> Current code is:
>
> system("lsof $file");
> if ( $? == 0 ) {
>    print " success - not locked, exit status = $?\n";
> } else {
>    print " failure - locked, exit status = $?\n";
> }
>
> This always returns failure with a exit status of 256. Any ideas why?

A value of 256 in $? doesn't indicate failure. It indicates that lsof was
executed successfully and returned an exit status of 1.

From "perldoc -f system":

    if ($? == -1) {
       print "failed to execute: $!\n";
    }
    elsif ($? & 127) {
       printf "child died with signal %d, %s coredump\n",
           ($? & 127),  ($? & 128) ? 'with' : 'without';
    }
    else {
       printf "child exited with value %d\n", $? >> 8;
    }

At any rate, you probably want to capture the output of lsof anyway - the
return code will simply tell you whether lsof was able to run, not whether
the given file is open.

To capture the output of lsof, you'll want to use backticks or a piped open -
see "perldoc perlipc" for more.

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 23:56:42 +0800
From: "sonet" <sonet.all@msa.hinet.net>
Subject: what is the best choose fork or thread?
Message-Id: <ek4gc0$82u$1@netnews.hinet.net>

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





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

Date: 23 Nov 2006 17:11:02 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: what is the best choose fork or thread?
Message-Id: <4sm316F1072beU1@mid.dfncis.de>

sonet <sonet.all@msa.hinet.net> wrote in comp.lang.perl.misc:
> 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

Who knows?  Your problem description is too vague for a meaningful
answer.

fork() works on win32, but is implemented in terms of threads.  Choose
the one whose interface matches your needs best, the base mechanism will
be the same in any case.

Anno


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

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


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