[21768] in Perl-Users-Digest
Perl-Users Digest, Issue: 3972 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 15 06:05:38 2002
Date: Tue, 15 Oct 2002 03:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 15 Oct 2002 Volume: 10 Number: 3972
Today's topics:
Re: 5.8.0 opening command bug ? <ajbetteridge@yahoo.com>
array of array? <jackkon@ms29.url.com.tw>
Re: array of array? <Tassilo.Parseval@post.rwth-aachen.de>
Can I have variables inside my pod? (Was: How can I tel <REMOVEstray_searcher@hotmail.com>
Re: Can I have variables inside my pod? (Was: How can I <bigiain@mightymedia.com.au>
Re: Can I have variables inside my pod? (Was: How can I <REMOVEstray_searcher@hotmail.com>
Importing & Exporting !! (Kiran)
Re: Importing & Exporting !! <krahnj@acm.org>
Re: io::select and individual response times <smackdab1@hotmail.com>
Re: Multiple Pings/Second <goldbb2@earthlink.net>
Perl to log into monster.com (Killerlou)
Re: Perl to log into monster.com (Helgi Briem)
Perl2exe problem. <spikey-wan@bigfoot.com>
Re: Read a single character from STDIN (W98) <goldbb2@earthlink.net>
Re: Regular scheduled download of specific URL? - take (Will Lee)
Re: Split of very large text file (Ravi)
Re: Split of very large text file (Ravi)
Re: Splitting CSV lines (Andrew Cashin)
Re: Splitting CSV lines (Andrew Cashin)
Re: To POE or not to POE (use Threads?) <troc@netrus.net>
Re: To POE or not to POE (use Threads?) <goldbb2@earthlink.net>
Re: Win32::NetAdmin (Helgi Briem)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 15 Oct 2002 10:20:32 +0100
From: AndyB <ajbetteridge@yahoo.com>
Subject: Re: 5.8.0 opening command bug ?
Message-Id: <8ennqukt3df7t0djsh996sg8elai92cej2@4ax.com>
Maybe the dnotify command has changed with this version of Mandrake as
well?
Andy.
On 11 Oct 2002 10:58:46 +0200, Alexandre BUSTICO
<alexandre.bustico@cena.fr> wrote:
>
>i have upgraded my linux box in mandrake 9.0, perl 5.8 commes bundled with, and
>now a simple script don't works anymore :
>
># i vait for dnotify output
># http://freshmeat.net/projects/dnotify/?topic_id=862
>open (FH, '-|', '/usr/local/bin/dnotify -mrcdR /tmp/ES') || die ("dnotify err");
>while (<FH>) {
> chomp ();
> print "DGB> $_\n";
>}
>
>normaly when there is activity in the directory the script should write the
>directory where it happens.
>It's work with 5.6, but hangs in 5.8, i have tried several options of perlio
>with no success.
>
>If i modify the script so that it reads stdin, and launch it like that :
>/usr/local/bin/dnotify -mrcdR /tmp/ES | script.pl
>
>then it works ...
>
>any clue ?
>
>Thanks
------------------------------
Date: Tue, 15 Oct 2002 15:08:52 +0800
From: "jackkon" <jackkon@ms29.url.com.tw>
Subject: array of array?
Message-Id: <aogejf$4p5@netnews.hinet.net>
hi, all
How to the convert a text file below to the array of array?
Thanks a lot.
========text file
01 AAAA-F.
03 AA-ERR PIC S9(05).
03 AA-FNAME PIC X(10).
03 AA-COUNT-K PIC 9(10).
01 AAAA-R.
03 AA-REC-KEY.
05 AA-DEPT-NO PIC X(02).
05 AA-DEPT-MAX PIC X(02).
03 AA-DEPT-NAME PIC X(12).
03 AA-BED-NO PIC 9(05).
03 AA-TOT-BED-NO PIC 9(05).
========array of array
[
01 AAAA-F.
[
03 AA-ERR PIC S9(05).
03 AA-FNAME PIC X(10).
03 AA-COUNT-K PIC 9(10).
]
01 AAAA-R.
[
03 AA-REC-KEY.
[
05 AA-DEPT-NO PIC X(02).
05 AA-DEPT-MAX PIC X(02).
]
03 AA-DEPT-NAME PIC X(12).
03 AA-BED-NO PIC 9(05).
03 AA-TOT-BED-NO PIC 9(05).
]
]
------------------------------
Date: 15 Oct 2002 09:27:39 GMT
From: "Tassilo v. Parseval" <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: array of array?
Message-Id: <aogn2b$rr2$1@nets3.rz.RWTH-Aachen.DE>
Also sprach jackkon:
> hi, all
> How to the convert a text file below to the array of array?
> Thanks a lot.
>
>========text file
> 01 AAAA-F.
> 03 AA-ERR PIC S9(05).
> 03 AA-FNAME PIC X(10).
> 03 AA-COUNT-K PIC 9(10).
> 01 AAAA-R.
> 03 AA-REC-KEY.
> 05 AA-DEPT-NO PIC X(02).
> 05 AA-DEPT-MAX PIC X(02).
> 03 AA-DEPT-NAME PIC X(12).
> 03 AA-BED-NO PIC 9(05).
> 03 AA-TOT-BED-NO PIC 9(05).
>
>========array of array
> [
> 01 AAAA-F.
> [
> 03 AA-ERR PIC S9(05).
> 03 AA-FNAME PIC X(10).
> 03 AA-COUNT-K PIC 9(10).
> ]
> 01 AAAA-R.
> [
> 03 AA-REC-KEY.
> [
> 05 AA-DEPT-NO PIC X(02).
> 05 AA-DEPT-MAX PIC X(02).
> ]
> 03 AA-DEPT-NAME PIC X(12).
> 03 AA-BED-NO PIC 9(05).
> 03 AA-TOT-BED-NO PIC 9(05).
> ]
> ]
Here is one that assumes that no 05-sequence directly follows a
01-sequence. It's surprisingly unelegant:
#! /usr/bin/perl -w
use strict;
use Data::Dumper;
my @data;
while (<DATA>) {
chomp;
s/^\s+//;
/^01/ &&
push @data, $_;
/^03/ && do {
if (ref $data[-1]) {
push @{ $data[-1] }, $_;
} else {
push @data, [ $_ ];
}
};
/^05/ && do {
if (ref $data[-1]->[-1]) {
push @{ $data[-1]->[-1] }, $_;
} else {
push @{ $data[-1] }, [ $_ ];
}
};
}
print Dumper \@data;
Tassilo
--
$_=q!",}])(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus;})(rekcah{lrePbus;})(lreP{rehtonabus;})(rehtona{tsuJbus!;
$_=reverse;s/sub/(reverse"bus").chr(32)/xge;tr~\n~~d;eval;
------------------------------
Date: Tue, 15 Oct 2002 06:21:33 GMT
From: Mac <REMOVEstray_searcher@hotmail.com>
Subject: Can I have variables inside my pod? (Was: How can I tell what version a module is?)
Message-Id: <818z101ap0.fsf_-_@kwikemart.springfield.se>
En dag, närmare bestämt 2002-10-09, plitade Eric J. Roode ner:
>
> Most modules have a $VERSION variable that tells you the version.
>
> I always put a =head1 VERSION section in my documentation; I wish
> more people would do that.
Can I have that added automagically?
I usally strip my modules version from cvs with something like this:
# get version from CVS
$VERSION = sprintf "%d.%02d", '$Revision: 1.13 $' =~ /(\d+)\.(\d+)/;
Now, is there a way to get this version show up inside the pod?
I.e. something along these lines:
,----
| <non-functional code>
|
| =head1 VERSION
|
| This is version $VERSION of my prog.
|
| </non-functional code>
`----
I guess that my question is if I can have variables evaluated inside
the pod?
/mac
--
.signature: No such file or directory
------------------------------
Date: Tue, 15 Oct 2002 17:20:55 +1000
From: Iain Chalmers <bigiain@mightymedia.com.au>
Subject: Re: Can I have variables inside my pod? (Was: How can I tell what version a module is?)
Message-Id: <bigiain-A46DFD.17205515102002@nasal.pacific.net.au>
In article <818z101ap0.fsf_-_@kwikemart.springfield.se>,
Mac <REMOVEstray_searcher@hotmail.com> wrote:
> En dag, närmare bestämt 2002-10-09, plitade Eric J. Roode ner:
>
> >
> > Most modules have a $VERSION variable that tells you the version.
> >
> > I always put a =head1 VERSION section in my documentation; I wish
> > more people would do that.
>
> Can I have that added automagically?
>
> I usally strip my modules version from cvs with something like this:
>
> # get version from CVS
> $VERSION = sprintf "%d.%02d", '$Revision: 1.13 $' =~ /(\d+)\.(\d+)/;
>
> Now, is there a way to get this version show up inside the pod?
> I.e. something along these lines:
>
> ,----
> | <non-functional code>
> |
> | =head1 VERSION
> |
> | This is version $VERSION of my prog.
> |
> | </non-functional code>
> `----
>
> I guess that my question is if I can have variables evaluated inside
> the pod?
>
You can just let cvs do it for you...
$VERSION = sprintf "%d.%02d", '$Revision: 1.13 $' =~ /(\d+)\.(\d+)/;
=head1 VERSION
This is version $Revision: 1.13 $ of my prog.
big
------------------------------
Date: Tue, 15 Oct 2002 09:03:23 GMT
From: Mac <REMOVEstray_searcher@hotmail.com>
Subject: Re: Can I have variables inside my pod? (Was: How can I tell what version a module is?)
Message-Id: <813cr81378.fsf@kwikemart.springfield.se>
En dag, närmare bestämt 2002-10-15, plitade Iain Chalmers ner:
[...]
> You can just let cvs do it for you...
>
>
> $VERSION = sprintf "%d.%02d", '$Revision: 1.13 $' =~ /(\d+)\.(\d+)/;
>
> =head1 VERSION
> This is version $Revision: 1.13 $ of my prog.
>
Doh! *smacks myself in the forehead* What was I thinking?
Thanks!
/mac
--
.signature: No such file or directory
------------------------------
Date: 14 Oct 2002 22:48:17 -0700
From: kchaggar22@yahoo.com.au (Kiran)
Subject: Importing & Exporting !!
Message-Id: <dfc77e0d.0210142148.14601569@posting.google.com>
Hi All,
I have opened a file for reading / writing to, with this file, I am
currently doing a line by line search for a certain text string. When
the program finds this text string, it's supposed to replace it with
another string and then print this new data to the file. The current
program does find this string and replace it with what I want however
it does not write this new value to the file. Here is the code:
open(BASEFILE, "+<D:/Perl/KC/NodeB/basedefault.xml") || die ("Error:
cannot open default NodeB BaseNECDF.xml\n");
while (<BASEFILE>)
{
@t = <BASEFILE>;
@parameters = grep /Attr||Class/, @t;
foreach $record (@parameters)
{
$_ = $record;
if (/\Class/)
{
($crtnum, $class, $classid) =
/(".*")\WClass\W(".*")\WID\W(".*")/;
$class =~ tr/"/ /;
} else {
($para, $pvalue) = /(".*")\WVa\W(".*")/;
}
if ($class =~ / atmIpIf/)
{
$class =~ s/atmIpIf/crap/;
print BASEFILE $class;
}
}
}
The substitution replaces the string atmIpIf with the string crap
however the last line for print does not print the new value crap into
the file.
Could someone please tell me what I am doing wrong.
Thanks !!
------------------------------
Date: Tue, 15 Oct 2002 07:22:04 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Importing & Exporting !!
Message-Id: <3DABC1EF.EDBF69D4@acm.org>
Kiran wrote:
>
> I have opened a file for reading / writing to, with this file, I am
> currently doing a line by line search for a certain text string. When
> the program finds this text string, it's supposed to replace it with
> another string and then print this new data to the file. The current
> program does find this string and replace it with what I want however
> it does not write this new value to the file.
perldoc -q "How do I change one line in a file"
Found in /usr/lib/perl5/5.6.0/pod/perlfaq5.pod
How do I change one line in a file/delete a line in a
file/insert a line in the middle of a file/append to the
beginning of a file?
John
--
use Perl;
program
fulfillment
------------------------------
Date: Tue, 15 Oct 2002 05:34:11 GMT
From: "smackdab" <smackdab1@hotmail.com>
Subject: Re: io::select and individual response times
Message-Id: <nNNq9.151748$S32.10855149@news2.west.cox.net>
works like a champ, didn't realize the details about select...
THANKS !!!!!!!!!!!!!!!!!!!!!!!
BTW,
I use:
if( $! = $sock->sockopt(SO_ERROR) )
{ print "Error reaching $port: $^E"; }
for the error test...I think it came from another post of yours ;-)
"Benjamin Goldberg" <goldbb2@earthlink.net> wrote in message
news:3DAA527B.E712122F@earthlink.net...
> smackdab wrote:
> >
> > I am sending a couple of non-blocking TCP connect calls at once...
> >
> > I then do a $select->can_write($timeout) to see how many accepted my
> > connection requests...
> >
> > Is there any way to get timing info from each connection?
> >
> > I can set a hires time before I send out the connects, but since the
> > can_write() blocks I don't know when individual ones came back...
>
> The can_write method should only block until the first one becomes
> ready, not until they all become ready.
>
> So, you could do:
> my $time = time;
> my $sel = IO::Select->new;
> # stuff to initiate nonblocking connects.
> while( $sel->count ) {
> my @w = $sel->can_write;
> my $took = time() - $time;
> printf "Connection to %s took %f seconds.\n",
> inet_ntoa($_->peerhost), $took for @w;
> $sel->remove(@w); # this line is important!
> }
>
> [untested, error checking ommited for brevity. You ought to check
> $socket->sockopt(SO_ERROR) to tell whether it was a successful connect
> or an error that caused the select to succeed on that socket.]
>
> > I think I looked through all of the IO::Socket and IO::Select pod
> > pages but didn't see anything to do this.
> >
> > thanks for any suggestions!
>
> --
> my $n = 2; print +(split //, 'e,4c3H r ktulrnsJ2tPaeh'
> ."\n1oa! er")[map $n = ($n * 24 + 30) % 31, (42) x 26]
------------------------------
Date: Tue, 15 Oct 2002 00:53:45 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Multiple Pings/Second
Message-Id: <3DAB9F59.7A739FA0@earthlink.net>
smackdab wrote:
>
> It seems that the orig computed checksum is NOT the same checksum as
> what comes back from a ping (might only be in my specific case)
> BUT, Net::Ping doesn't check it and if I *make* it check, the
> checksums don't match!
How peculiar. Hmm.... *doh* ... the checksum on the return message
needs to be a checksum *of* the returned message. And since the
returned message has *different* data in it (message type 0, indicating
echo repy, instead of message type 8, echo request), it should have a
different checksum!
I think the best thing to do is just ignore the checksum of the recieved
icmp packet entirely.
--
my $n = 2; print +(split //, 'e,4c3H r ktulrnsJ2tPaeh'
."\n1oa! er")[map $n = ($n * 24 + 30) % 31, (42) x 26]
------------------------------
Date: 14 Oct 2002 22:54:21 -0700
From: lou@writeme.com (Killerlou)
Subject: Perl to log into monster.com
Message-Id: <459f30dc.0210142154.52e2885a@posting.google.com>
I don't want to repeat what has already been done.
Is there a perl script out there that will login to a monster.com account and
make a small change to a resume and log out again. I want to automate
refreshing my resume every so often.
------------------------------
Date: Tue, 15 Oct 2002 09:37:53 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: Perl to log into monster.com
Message-Id: <3dabe0f8.341915788@news.cis.dfn.de>
On 14 Oct 2002 22:54:21 -0700, lou@writeme.com (Killerlou)
wrote:
>I don't want to repeat what has already been done.
>Is there a perl script out there that will login to a monster.com account and
>make a small change to a resume and log out again. I want to automate
>refreshing my resume every so often.
use LWP::UserAgent;
http://perldoc.com/perl5.8.0/lib/LWP/UserAgent.html
--
Regards, Helgi Briem
helgi AT decode DOT is
A: Top posting
Q: What is the most irritating thing on Usenet?
- "Gordon" on apihna
------------------------------
Date: Tue, 15 Oct 2002 10:35:40 +0100
From: "Richard S Beckett" <spikey-wan@bigfoot.com>
Subject: Perl2exe problem.
Message-Id: <aognim$473$1@newshost.mot.com>
Chaps,
I really don't understand what's going on here, and I have read the
documentation.
I'm trying to use perl2exe on my script, I get the following errors, and I
don't know what to do next.
Converting 'testing.pl' to testing.exe
Warning: Can't locate Convert/EBCDIC.pm at D:\Perl\site\lib\Net\Cmd.pm line
19
@INC = D:\Perl\lib, D:\Perl\site\lib, .
Warning: Can't locate Mac/InternetConfig.pm at
D:\Perl\site\lib\Net\Config.pm line 40
@INC = D:\Perl\lib, D:\Perl\site\lib, .
When I run the .exe, I get the following...
D:\Perl\My Scripts\Working>testing.exe
Loading spreadsheet, please wait...
Please see the Perl2Exe user manual under "#perl2exe_include run-time
messages"
for an explanation of the following message(s)
#perl2exe_include D:\Perl\My Scripts\Working/settings.txt
The lines mentioned are:
19 use Net::Cmd;
40 our $settings = "settings.txt";
I have an external file called settings.txt, which is a perl script which
sets up some stored variables. It is executed like this...
do $settings if -e $settings;
ans simply contains lines, like...
$savespreadsheet = "results.xls";
Please help!
Thanks.
R.
------------------------------
Date: Tue, 15 Oct 2002 00:39:20 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Read a single character from STDIN (W98)
Message-Id: <3DAB9BF8.94178C4A@earthlink.net>
Nemo Oudeheis wrote:
>
> I am using ActivePerl on a Win98 system. I would like to read a
> single character from STDIN to get the reply from a (Y/N) question,
> without having to terminate the line with by hitting <ENTER>, as is
> the default with getc and read.
Maybe Win32::Console will work?
--
my $n = 2; print +(split //, 'e,4c3H r ktulrnsJ2tPaeh'
."\n1oa! er")[map $n = ($n * 24 + 30) % 31, (42) x 26]
------------------------------
Date: 15 Oct 2002 01:49:46 -0700
From: willee1@hotmail.com (Will Lee)
Subject: Re: Regular scheduled download of specific URL? - take 2
Message-Id: <25e033d6.0210150049.619d0df@posting.google.com>
Andras Malatinszky <nobody@dev.null> wrote in message news:<3DAB6746.4060803@dev.null>...
>
> I hope that helps.
Thanks, it does!
------------------------------
Date: 14 Oct 2002 21:46:00 -0700
From: ranam@ue.com.au (Ravi)
Subject: Re: Split of very large text file
Message-Id: <66d1df6a.0210142045.8d07d2f@posting.google.com>
Thanks John - this works great.
...ravi
"John W. Krahn" <krahnj@acm.org> wrote in message news:<3DAA548D.230E2302@acm.org>...
> Ravi wrote:
> >
> > Here's my problem:
> >
> > I have a very large file (between 70-110 Mb of Ascii) composed of one
> > single line, that I need to split into multiple lines. This file is a
> > log of one of our running daemons and the daemon just appends messages
> > onto the end of the line.
> >
> > There is a message header though, (XYZ2000), at the start of each
> > message that gets appended. What I would like is to be able to split
> > the line according to that header, so that each new line looks
> > something like :
> >
> > XTY2000adasgfsgdsgsd g...
> > XTY2000gjhfgjfgjhfgjfgjh...
> > XTY2000qweqeqwreqrq...etc
> >
> > and so on.
> >
> > I don't want to read the entire file into a variable and then split by
> > the XTY2000 pattern as this will tie up memory. Is there a way to
> > split this file on the fly ? Any suggestions will be appreciated.
>
>
> perl -i~ -lpe'BEGIN{$\="\n".($/="XTY2000")}' yourfile
>
>
> John
------------------------------
Date: 15 Oct 2002 00:25:53 -0700
From: ranam@ue.com.au (Ravi)
Subject: Re: Split of very large text file
Message-Id: <66d1df6a.0210142325.3fc7d774@posting.google.com>
Thanks for the help pkent - I've tried this code as well and it works just fine.
..ravi
pkent <pkent77tea@yahoo.com.tea> wrote in message news:<pkent77tea-487F94.02053515102002@news-text.blueyonder.co.uk>...
> In article <66d1df6a.0210132009.61370e3c@posting.google.com>,
> ranam@ue.com.au (Ravi) wrote:
>
> > I have a very large file (between 70-110 Mb of Ascii) composed of one
> ....
> > There is a message header though, (XYZ2000), at the start of each
> > message that gets appended. What I would like is to be able to split
>
> if the message header is a fixed string, then perl can do this for you,
> no problems. See code at bottom of message.
>
> P
>
> <<<CODE>>>
> #!/usr/bin/perl -w
> use strict;
>
> $/ = 'XYZ2000';
> while(<DATA>) {
> chomp;
> print "We got: <$_>\n";
> }
>
> __DATA__
> XYZ2000record1asdfasdfasdfXYZ2000record2kjfdhkljhkljhlkjhlkjhlkdfjghdflkj
> hlkjhXYZ2000record3737373737373737XYZ2000record4mnfieuhn
> kjgh iguh gih rguh uo iuh XYZ2000 record5 *&^(*&^(*&^(*&^(*&^
>
>
> __END__
>
>
> Results:
>
> dev~/src > perl ./yy.pl
> We got: <>
> We got: <record1asdfasdfasdf>
> We got: <record2kjfdhkljhkljhlkjhlkjhlkdfjghdflkjhlkjh>
> We got: <record3737373737373737>
> We got: <record4mnfieuhn
> kjgh iguh gih rguh uo iuh >
> We got: < record5 *&^(*&^(*&^(*&^(*&^
> >
------------------------------
Date: 15 Oct 2002 02:51:54 -0700
From: ajc81@hotmail.com (Andrew Cashin)
Subject: Re: Splitting CSV lines
Message-Id: <49b3792a.0210150151.2c76d91d@posting.google.com>
That would be an example of brain-fade. I would always have
just used Text::CSV too, had I found it (and not the other CSV module on
CPAN... the name eludes me) before writing my own...
diff -u1 -r1.1 split_csv.pl
--- split_csv.pl 2002/10/15 08:16:23 1.1
+++ split_csv.pl 2002/10/15 08:17:05
@@ -5,3 +5,3 @@
# as perl itself. I don't promise that it will help, and refer all to the
-# unsplit_csv perl module on CPAN.
+# Text::CSV perl module on CPAN.
"Aaron Simmons" <asimmons@mitre.org> wrote in message news:<aoesmp$nt7$1@newslocal.mitre.org>...
> I've always just used Text::CSV. What is unsplit_csv?
------------------------------
Date: 15 Oct 2002 02:57:54 -0700
From: ajc81@hotmail.com (Andrew Cashin)
Subject: Re: Splitting CSV lines
Message-Id: <49b3792a.0210150157.5c1960ea@posting.google.com>
Benjamin Goldberg <goldbb2@earthlink.net> wrote in message news:<3DAB2960.673A0F3A@earthlink.net>...
> [snip]
> > @elements=split(/,/);
> [snip]
>
> Hmm, first you split on commas, then you go and fix places where it was
> the wrong thing to do? Why not try and do it right in the first place?
>
> my $line = ....;
> my @cols = $line =~ m[
> (?:^|\G,) # anchor at beginning of line, or after comma.
> (
> " (?> (?:[^"]+|"")* ) "
> | [^,]*
> )
> ]xg;
> s/^"(.*)"\z/$1/ and s/""/"/g for @cols;
> [untested]
Well two reasons. Firstly I just had the idea in my head and wanted to
see if it would work, and secondly I can only just follow your re, and
certainly couldn't have written it myself. Oh yes, and it seemed like
a good idea at the time ;-)
------------------------------
Date: Tue, 15 Oct 2002 04:38:48 -0000
From: Rocco Caputo <troc@netrus.net>
Subject: Re: To POE or not to POE (use Threads?)
Message-Id: <slrnaqn6ue.8ma.troc@eyrie.homenet>
On Mon, 14 Oct 2002 20:44:55 -0600, Ron Reidy wrote:
>
> I have a problem. I need to re-engineer a batch process that was not
> written for performance. I have several tasks that I need to run for a
> group of tables in an Oracle instance. The tasks for each table (~80 of
> them) include:
>
> 1. Truncating tables in the destination instance
> 2. Saving index information.
> 3. Bulk load the tables.
> 4. Reconstruct the indexes.
>
> I need all of the above tasks to execute as a "group", and as they
> finish, I will need to know what the status of each "group" was.
>
> I want to use a threaded type of application. I am thinking POE or
> threads would do what I want. Can anyone tell me if threads in 5.8.0 is
> stable and production ready, or would POE be the better choice..
>
> My environment is:
> Solaris 8 (64 bit)
> Perl 5.8.0
There's an outstanding bug in 5.8.0+threads that affects POE, so you
might run into problems using it in your environment.
I'm not sure how threads and the Oracle DBD get along. The DBI users'
mailing list would know more. I think you can get subscription
information at dbi-users-help@perl.org.
The CPAN has a couple POE components to run parallel DBI queries. I
think LaDBI gives better control over the order of operations than
DBIAgent, though. POE's mailing list might be a better place to ask.
Send a blank message to poe-help@perl.org for subscription info.
-- Rocco Caputo / troc@pobox.com / poe.perl.org / poe.sf.net
------------------------------
Date: Tue, 15 Oct 2002 01:10:36 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: To POE or not to POE (use Threads?)
Message-Id: <3DABA34C.533DBBEA@earthlink.net>
Ron Reidy wrote:
>
> Hi All,
>
> I have a problem. I need to re-engineer a batch process that was not
> written for performance. I have several tasks that I need to run for
> a group of tables in an Oracle instance. The tasks for each table
> (~80 of them) include:
>
> 1. Truncating tables in the destination instance
> 2. Saving index information.
> 3. Bulk load the tables.
> 4. Reconstruct the indexes.
>
> I need all of the above tasks to execute as a "group", and as they
> finish, I will need to know what the status of each "group" was.
>
> I want to use a threaded type of application. I am thinking POE or
> threads would do what I want. Can anyone tell me if threads in 5.8.0
> is stable and production ready, or would POE be the better choice..
While I don't know whether or not DBI will compile with threads, I *can*
say that there exist a couple of modules to make POE work with DBI:
POE::Component::LaDBI
POE::Component::DBIAgent
(I think that LaDBI has a nicer interface than DBIAgent, but that's just
from looking at the docs, not from trying each)
> My environment is:
> Solaris 8 (64 bit)
> Perl 5.8.0
>
> Thanks for your time and feedback.
> --
> Ron Reidy
> Oracle DBA
--
my $n = 2; print +(split //, 'e,4c3H r ktulrnsJ2tPaeh'
."\n1oa! er")[map $n = ($n * 24 + 30) % 31, (42) x 26]
------------------------------
Date: Tue, 15 Oct 2002 09:30:13 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: Win32::NetAdmin
Message-Id: <3dabde8c.341295897@news.cis.dfn.de>
On Mon, 14 Oct 2002 14:10:17 -0400, a246456@fmr.com wrote:
> I wrote a script which process a text file which contains list of
>servers, and checks whether the user account exist on the remote server.
>I am getting incorrect information like User does`nt exist on machine.
>
>I am not able to find what is the problem? Could you pls help me...
Simplify first and separate parsing the hosts file from
using Win32::NetAdmin::UsersExist.
When I try it for a single
$User = 'Administrator';
and my own workstation, it works fine.
When I check it for another workstation however,
it doesn't and is very slow about returning.
On the other hand, when I check for a legitimate
username and a domain server, it works again.
So, my suggestion is this (unchecked). I think you are
not allowed (rightly) to check another workstation for
local users unless you are a local user on that particular
workstation, but you can check for the existence
of domain users if you are a member of that domain.
None of this has anything to do with Perl. The Perl
part works just fine.
--
Regards, Helgi Briem
helgi AT decode DOT is
A: Top posting
Q: What is the most irritating thing on Usenet?
- "Gordon" on apihna
------------------------------
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.
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 3972
***************************************