[28041] in Perl-Users-Digest
Perl-Users Digest, Issue: 9405 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 29 06:05:58 2006
Date: Thu, 29 Jun 2006 03:05:04 -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 Thu, 29 Jun 2006 Volume: 10 Number: 9405
Today's topics:
accessing object variables from callback function <kaisung@gmail.com>
Re: crash on async in taint mode <nobull67@gmail.com>
Re: crash on async in taint mode <ynleder@nspark.org>
Re: crash on fork in taint mode <nobull67@gmail.com>
Re: crash on fork in taint mode <nobull67@gmail.com>
Debugging Memory consumption for Perl Program <janicehwang1325@yahoo.com>
Re: global variables in a web service <tadmc@augustmail.com>
Re: global variables in a web service <nobull67@gmail.com>
Re: global variables in a web service <benmorrow@tiscali.co.uk>
Re: How to ignore 1st line in a file when reading <mumia.w.18.spam+nospam.usenet@earthlink.net>
Re: How to ignore 1st line in a file when reading <el.dodgero@gmail.com>
Re: How to ignore 1st line in a file when reading <benmorrow@tiscali.co.uk>
Re: How to ignore 1st line in a file when reading <nobull67@gmail.com>
Re: How to ignore 1st line in a file when reading <someone@example.com>
Re: How to ignore 1st line in a file when reading anno4000@zrz.tu-berlin.de
Re: How to pass an array and scalar as arguments to a s anno4000@zrz.tu-berlin.de
new CPAN modules on Thu Jun 29 2006 (Randal Schwartz)
Re: Problem with Multi- threaded Server <janicehwang1325@yahoo.com>
Re: Scalable method for searching in relatively big fil <simon.chao@gmail.com>
Re: Scalable method for searching in relatively big fil <kaz219@gawab.com>
Re: short-hand for same regex for multiple scalars? <alhuber@gmx.net>
Re: short-hand for same regex for multiple scalars? <nobull67@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 29 Jun 2006 02:23:06 -0700
From: "kaisung@gmail.com" <kaisung@gmail.com>
Subject: accessing object variables from callback function
Message-Id: <1151572986.362588.36720@y41g2000cwy.googlegroups.com>
Hi,
I'm trying to write a Class which uses XML::Parser. XML::Parser uses
callback functions. If I use an object method as the callback
function, how can I access object variables from within that callback
function if it doesn't get passed a reference to $self? Here's what I
have so far:
-----BEGIN PERL-----
package Test;
use XML::Parser;
sub new {
my $invocant = shift;
my $class = ref($invocant) || $invocant;
my $self = { @_ };
bless($self, $class);
return $self;
}
sub load {
my $parser = new XML::Parser(ErrorContext => 2);
$parser->setHandlers(Start => \&_start_handler);
$parser->parsefile("file.xml");
}
sub _start_handler {
# In this function, I want to set $self->{var}, however don't have
# access to $self
}
sub getVar {
my $self = shift;
return $self->{var};
}
-----END PERL-----
Thanks in advance,
-Kai
------------------------------
Date: 28 Jun 2006 23:32:42 -0700
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: crash on async in taint mode
Message-Id: <1151562762.214686.211470@b68g2000cwa.googlegroups.com>
Yohan N. Leder wrote:
> To replace a fork() which crashes ActivePerl 5.8.8 in taint mode, I've
> tried to go through creation of a thread... And it crashes too !
>
> #!/usr/bin/perl -wT
> use threads;
> print "Content-type: text/html\n\n";
> my $thr = async{print "<p>thread in progress...</p>"};
> die "thread failure\n" unless defined($thr);
> $thr->detach();
> sleep(1);
> print "<p>main in progress...</p>";
> exit 0;
>
> ActivePerl falls in exception on async{} block.
> What's wrong again ?
Windows doesn't have a real fork(). It is emulated with threads, so I
suspect you are seeing the same bug.
------------------------------
Date: Thu, 29 Jun 2006 11:36:14 +0200
From: Yohan N. Leder <ynleder@nspark.org>
Subject: Re: crash on async in taint mode
Message-Id: <MPG.1f0dbd74f0d04149898af@news.tiscali.fr>
In article <1151562762.214686.211470@b68g2000cwa.googlegroups.com>,
nobull67@gmail.com says...
>
> Yohan N. Leder wrote:
> > To replace a fork() which crashes ActivePerl 5.8.8 in taint mode, I've
> > tried to go through creation of a thread... And it crashes too !
> >
> > #!/usr/bin/perl -wT
> > use threads;
> > print "Content-type: text/html\n\n";
> > my $thr = async{print "<p>thread in progress...</p>"};
> > die "thread failure\n" unless defined($thr);
> > $thr->detach();
> > sleep(1);
> > print "<p>main in progress...</p>";
> > exit 0;
> >
> > ActivePerl falls in exception on async{} block.
> > What's wrong again ?
>
> Windows doesn't have a real fork(). It is emulated with threads, so I
> suspect you are seeing the same bug.
>
>
Thanks. Then, it sounds I have to go through Win32::Process as you said
in the other thread.
------------------------------
Date: 29 Jun 2006 00:28:02 -0700
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: crash on fork in taint mode
Message-Id: <1151566082.789948.312550@x69g2000cwx.googlegroups.com>
Yohan N. Leder wrote:
> In article <1151443070.093979.120750@y41g2000cwy.googlegroups.com>,
> nobull67@gmail.com says...
> >
> > Yohan N. Leder wrote:
> > > Hello. I'm using ActivePerl 5.8.8 build 817 and Apache2 for Windows. The
> > > script below crashes on fork() when I run it in taint mode (not if I
> > > remove -T).
> >
> > > Did you seen something like this ?
> >
> > Yes,
> >
> > http://groups.google.com/groups/search?q=fork+taint
> >
> >
>
> So, what's the workaround ?
That would very much depend on why you are forking. Particularly
baring in mind that this is windows so you aren't really getting proper
fork() semantics anyhow. Maybe you could use system() or
Win32::Process.
------------------------------
Date: 29 Jun 2006 00:29:19 -0700
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: crash on fork in taint mode
Message-Id: <1151566159.846032.200310@d56g2000cwd.googlegroups.com>
Yohan N. Leder wrote:
> In article <1151443070.093979.120750@y41g2000cwy.googlegroups.com>,
> nobull67@gmail.com says...
> >
> > Yohan N. Leder wrote:
> > > Hello. I'm using ActivePerl 5.8.8 build 817 and Apache2 for Windows. The
> > > script below crashes on fork() when I run it in taint mode (not if I
> > > remove -T).
> >
> > > Did you seen something like this ?
> >
> > Yes,
> >
> > http://groups.google.com/groups/search?q=fork+taint
> >
> >
>
> Does building the Perl 5.8.8 for Windows from
> <http://www.perl.com/download.csp>, rather than using ActivePerl 5.8.8,
> will resolve this fork/taint problem ?
Looking at the first few hits in the above search would indicate that
it would not.
------------------------------
Date: 29 Jun 2006 00:41:12 -0700
From: "janicehwang1325@yahoo.com" <janicehwang1325@yahoo.com>
Subject: Debugging Memory consumption for Perl Program
Message-Id: <1151566872.922528.215470@y41g2000cwy.googlegroups.com>
Hi,
I would like to know is there any way to debug the memory consumption
of a perl program running? For example, I have a program running and i
would like to keep tract of the memory consumption of this program so
that I can retart the program if the memory consumption is going to
high. Thank you very much.
------------------------------
Date: Wed, 28 Jun 2006 22:29:31 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: global variables in a web service
Message-Id: <slrnea6i8r.uuc.tadmc@magna.augustmail.com>
sal.x.lopez@gmail.com <sal.x.lopez@gmail.com> wrote:
> How do I set global variables
"Coping with Scoping":
http://perl.plover.com/FAQs/Namespaces.html
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 28 Jun 2006 23:29:09 -0700
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: global variables in a web service
Message-Id: <1151562549.712938.240560@d56g2000cwd.googlegroups.com>
sal.x.lopez@gmail.com wrote:
> How do I set global variables in a web service script so that they are
> available to all functions? In my code below, and when called by the
> client, the variable $str is empty within the helloWorld subroutine.
>
> #!/bin/perl
>
> use SOAP::Transport::HTTP;
> SOAP::Transport::HTTP::CGI
> ->dispatch_to('DEMO')
> ->handle;
>
> package DEMO;
>
> my $str = "Hello World";
>
> sub helloWorld {
>
> my ($arg1, $arg2) = @_;
>
> print "$str\n";
>
> # do other stuff
>
> }
You should always enable warnings.
I'm guessing you are running this under mod_perl. If so you should see
your logs full of ..
Variable "..." will not stay shared
This is because Perl doesn't properly implement nested subroutines in
the was that, say, Pascal does and mod_perl wraps you script in "sub
handler {...}".
For details look up the above warning message in perldiag.
My perfered solution is to use package variables and dynamic scoping.
Yes I realise that there are issues with package variables and dynamic
scoping but this really is one of those cases where the disadvantages
are minimal. Would still advise all to understand the semantics of
package variables before usign them. See the local() and our()
functions.
I perfer to say "package variables" not "global variables" because as
the OP correctly implied the file-scoped lexical is also a global
variable of sorts from the design point of view.
When using CGI scripts under mod_perl simply replace "my" by "local
our" for those variables declared in the outermost scope which trigger
the will not stay shared
warning.
Note this is still a somewhat dirty hack. Consider instead moving DEMO
into a separate ,pm file or writing a real mod_perl handler rather than
using one of the CGI emmulation modes.
------------------------------
Date: Thu, 29 Jun 2006 05:12:44 +0100
From: Ben Morrow <benmorrow@tiscali.co.uk>
Subject: Re: global variables in a web service
Message-Id: <si0cn3-3bn.ln1@osiris.mauzo.dyndns.org>
Quoth "Dodger" <el.dodgero@gmail.com>:
>
> For that case, use our() not my(), or predeclare the variable.
>
> our() creates a package global.
> This is not necessarily a true global, especially in a webserver
> environment.
Please explain what you think a 'true' global is if a package variable
isn't one.
Ben
--
Heracles: Vulture! Here's a titbit for you / A few dried molecules of the gall
From the liver of a friend of yours. / Excuse the arrow but I have no spoon.
(Ted Hughes, [ Heracles shoots Vulture with arrow. Vulture bursts into ]
'Alcestis') [ flame, and falls out of sight. ] benmorrow@tiscali.co.uk
------------------------------
Date: Thu, 29 Jun 2006 01:33:41 GMT
From: "Mumia W." <mumia.w.18.spam+nospam.usenet@earthlink.net>
Subject: Re: How to ignore 1st line in a file when reading
Message-Id: <V5Gog.3001$NP4.810@newsread1.news.pas.earthlink.net>
Jim Gibson wrote:
> In article <xKDog.274$vt2.73@newsread2.news.pas.earthlink.net>, Mumia
> W. <mumia.w.18.spam+nospam.usenet@earthlink.net> wrote:
>
>> Tim Hammerquist wrote:
>>> Here's my solution, very similar to another poster's:
>>>
>>> open FH, "<filename" or die "can't open: $!";
>>> <FH>; # discards first line [...]
>> No, it probably discards the file. In a list context (the default), <FH>
>> returns a list of all the the remaining lines in the file. To get a
>> single line, do this:
>>
>> scalar <FH>;
>
>
> Easy to test:
> [...]
It looks like I was wrong. I had a program where that happened, and I
concluded that <FH> by itself was read in list context. I used this line :
print <FH>;
And I got the rest of the file. But <FH> by itself works fine.
------------------------------
Date: 28 Jun 2006 19:29:21 -0700
From: "Dodger" <el.dodgero@gmail.com>
Subject: Re: How to ignore 1st line in a file when reading
Message-Id: <1151548161.362114.175460@75g2000cwc.googlegroups.com>
Mumia W. wrote:
> It looks like I was wrong. I had a program where that happened, and I
> concluded that <FH> by itself was read in list context. I used this line :
> print <FH>;
> And I got the rest of the file. But <FH> by itself works fine.
Yup. Print treats its arguments as list context (except the filehandle
if present) and thus would do that. That's why if you print an array
you get the whole array (joined by the output record seperator, which
is undef by default), not the number of items in the array.
my @ary = qw(a b c d e f);
my $sc_ary = @ary;
print $sc_ary, @ary;
# prints 6abcdef
------------------------------
Date: Thu, 29 Jun 2006 05:17:54 +0100
From: Ben Morrow <benmorrow@tiscali.co.uk>
Subject: Re: How to ignore 1st line in a file when reading
Message-Id: <is0cn3-3bn.ln1@osiris.mauzo.dyndns.org>
Quoth "Dodger" <el.dodgero@gmail.com>:
>
> Jim Gibson wrote:
> > In article <xKDog.274$vt2.73@newsread2.news.pas.earthlink.net>, Mumia
> > W. <mumia.w.18.spam+nospam.usenet@earthlink.net> wrote:
> >
> > > Tim Hammerquist wrote:
> > > >
> > > > Here's my solution, very similar to another poster's:
> > > >
> > > > open FH, "<filename" or die "can't open: $!";
> > > > <FH>; # discards first line [...]
> > >
> > > No, it probably discards the file. In a list context (the default), <FH>
> > > returns a list of all the the remaining lines in the file. To get a
> > > single line, do this:
> > >
> > > scalar <FH>;
>
> Jim and Tim are right. Mumia is half right.
No, Mumia is wrong.
> Yes, in a list context <FH> would discard the whole file.
> However, on a line by itself, <FH> is not in list context. It's in
> scalar context and thus just pulls one line, just like when it's in the
> well-known while (<FH>) {} block (as the () on a while indicate a
> conditional, not a list context).
No, the <FH> is in void context. Most builtins (including <>) treat this
the same as scalar context.
> I haven't tested it, but I'd be more wary of the possibility of Mumia's
> suggestion doing what Mumia wants to avoid. Since scalar() explicitly
> casts something into scalar context, I'd be concerned that it
> implicitly treats it in a list context to do so,
*Please* don't talk nonsense about things you don't understand. scalar
evaluates its argument in scalar context, and returns the result. End of
story.
> which, if the case,
> would have the paradoxical effect of slupring the whole file and
> returning the number of lines in it.
No, 'cos the only builtin that returns its size in scalar context is an
array. The effect of attempting to evaluate a random list in scalar
context is to return just the last value.
> Then again, the whole 'DWIM' philosophy might mean that such a case is
> checked for beforehand behind the scenes and that situation avoided.
No, no DWIM here. Just rules being followed.
> Again, I'm not sure on that one
> either way. I'd have to try it, and I'm not gonna right now. But it
> would have me more wary than just the implicitly scalar <FH> by itself,
> as statements are in scalar context unless stated otherwise.
Expressions are in void context unless on the RHS of an assignment.
Ben
--
Heracles: Vulture! Here's a titbit for you / A few dried molecules of the gall
From the liver of a friend of yours. / Excuse the arrow but I have no spoon.
(Ted Hughes, [ Heracles shoots Vulture with arrow. Vulture bursts into ]
'Alcestis') [ flame, and falls out of sight. ] benmorrow@tiscali.co.uk
------------------------------
Date: 29 Jun 2006 00:11:45 -0700
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: How to ignore 1st line in a file when reading
Message-Id: <1151565105.100199.38550@i40g2000cwc.googlegroups.com>
John W. Krahn wrote:
> Dodger wrote:
> > Jim Gibson wrote:
> >>In article <xKDog.274$vt2.73@newsread2.news.pas.earthlink.net>, Mumia
> >>W. <mumia.w.18.spam+nospam.usenet@earthlink.net> wrote:
> >>
> >>>Tim Hammerquist wrote:
> >>>><FH>; # discards first line [...]
> >>>No, it probably discards the file. In a list context (the default), <FH>
> >>>returns a list of all the the remaining lines in the file. To get a
> >>>single line, do this:
> >>>
> >>>scalar <FH>;
> >
> > Jim and Tim are right. Mumia is half right.
> >
> > Yes, in a list context <FH> would discard the whole file.
> > However, on a line by itself, <FH> is not in list context. It's in
> > scalar context and thus just pulls one line,
>
> Actually it is in void context, which in this case behaves the same as scalar
> context.
Actually <FH> (or any expression) as a statement by itself is in a void
context if unless it happens to be the last statement in a block.
If it is the last statement in a block it's in whatever context the
block is being evaluated in. Very often this will still be the void
context.
I generally recommend explicitly forcing a scalar context on <> in this
case even though 99.9% of the time it is redundant.
------------------------------
Date: Thu, 29 Jun 2006 08:22:24 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: How to ignore 1st line in a file when reading
Message-Id: <45Mog.103774$S61.18863@edtnps90>
Ben Morrow wrote:
> Quoth "Dodger" <el.dodgero@gmail.com>:
>>
>>Again, I'm not sure on that one
>>either way. I'd have to try it, and I'm not gonna right now. But it
>>would have me more wary than just the implicitly scalar <FH> by itself,
>>as statements are in scalar context unless stated otherwise.
>
> Expressions are in void context unless on the RHS of an assignment.
Or on the RHS of an operator or on the RHS of a statement modifier...
$ perl -le'
sub test { print defined wantarray ? wantarray ? "LIST" : "SCALAR" : "VOID" }
test;
scalar test;
grep 1, test;
map 1, test;
1 if test;
ord test;
rand test;
'
VOID
SCALAR
LIST
LIST
SCALAR
SCALAR
SCALAR
John
--
use Perl;
program
fulfillment
------------------------------
Date: 29 Jun 2006 08:57:56 GMT
From: anno4000@zrz.tu-berlin.de
Subject: Re: How to ignore 1st line in a file when reading
Message-Id: <4ghj0kF1n2nl7U2@news.dfncis.de>
Dodger <el.dodgero@gmail.com> wrote in comp.lang.perl.misc:
[printing an array]
> Yup. Print treats its arguments as list context (except the filehandle
> if present) and thus would do that. That's why if you print an array
> you get the whole array (joined by the output record seperator, which
> is undef by default), not the number of items in the array.
Imprecise.
s/output record separator/output field separator/;
s/undef/an empty string/;
Anno
------------------------------
Date: 29 Jun 2006 08:25:36 GMT
From: anno4000@zrz.tu-berlin.de
Subject: Re: How to pass an array and scalar as arguments to a subroutine/
Message-Id: <4ghh40F1n2nl7U1@news.dfncis.de>
Mumia W. <mumia.w.18.spam+nospam.usenet@earthlink.net> wrote in comp.lang.perl.misc:
> sub unhash_array {
> map m/(\w+)/ && $1, @_;
> }
A capturing regex in list context returns the list of captures (a single
one in your case) on success and an empty list on failure. No need to
refer to $1.
sub unhash_array { map m/(\w+)/, @_ }
Anno
------------------------------
Date: Thu, 29 Jun 2006 04:42:07 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Thu Jun 29 2006
Message-Id: <J1LuE7.v3M@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-Canadian-0.01
http://search.cpan.org/~jcap/Acme-Canadian-0.01/
Canooks in your code, eh?
----
Acme-Canadian-0.02
http://search.cpan.org/~jcap/Acme-Canadian-0.02/
Canooks in your code, eh?
----
Acme-Canadian-0.03
http://search.cpan.org/~jcap/Acme-Canadian-0.03/
Canooks in your code, eh?
----
Algorithm-CheckDigits-0.40
http://search.cpan.org/~mamawe/Algorithm-CheckDigits-0.40/
Perl extension to generate and test check digits
----
Algorithm-CheckDigits-0.41
http://search.cpan.org/~mamawe/Algorithm-CheckDigits-0.41/
Perl extension to generate and test check digits
----
Astro-FITS-CFITSIO-1.05
http://search.cpan.org/~pratzlaff/Astro-FITS-CFITSIO-1.05/
Perl extension for using the cfitsio library
----
Authen-HOTP-0.01
http://search.cpan.org/~iwade/Authen-HOTP-0.01/
An HMAC-Based One-Time Password Algorithm
----
Best-0.05
http://search.cpan.org/~gaal/Best-0.05/
Fallbackable module loader
----
Business-PayPal-API-0.31
http://search.cpan.org/~scottw/Business-PayPal-API-0.31/
PayPal API
----
Cache-Memcached-1.18
http://search.cpan.org/~bradfitz/Cache-Memcached-1.18/
client library for memcached (memory cache daemon)
----
Catalyst-Runtime-5.70_03
http://search.cpan.org/~mramberg/Catalyst-Runtime-5.70_03/
Catalyst Runtime version
----
Chemistry-File-InternalCoords-0.02
http://search.cpan.org/~davidrw/Chemistry-File-InternalCoords-0.02/
Internal coordinates (z-matrix) molecule format reader/writer
----
Class-Pluggable-0.021
http://search.cpan.org/~takeshige/Class-Pluggable-0.021/
Simple pluggable class.
----
Config-Auto-0.18
http://search.cpan.org/~kane/Config-Auto-0.18/
Magical config file parser
----
DBIx-NamedQuery-0.11
http://search.cpan.org/~bolek/DBIx-NamedQuery-0.11/
Utilities for decoupling of Perl code and SQL statements
----
Date-Language-Hungarian-0.012
http://search.cpan.org/~lgoddard/Date-Language-Hungarian-0.012/
Magyar format for Date::Format
----
File-LibMagic-0.84
http://search.cpan.org/~fitzner/File-LibMagic-0.84/
Perlwrapper for libmagic
----
File-Stat-Bits-1.01
http://search.cpan.org/~fedorov/File-Stat-Bits-1.01/
stat(2) bit mask constants
----
Finance-Bank-NetBranch-0.06
http://search.cpan.org/~kulp/Finance-Bank-NetBranch-0.06/
Manage your NetBranch accounts with Perl
----
IPC-Run-Simple-1.2
http://search.cpan.org/~sfink/IPC-Run-Simple-1.2/
Simple system() wrapper
----
Image-Imlib2-1.10
http://search.cpan.org/~lbrocard/Image-Imlib2-1.10/
Interface to the Imlib2 image library
----
Imager-0.51_01
http://search.cpan.org/~tonyc/Imager-0.51_01/
Perl extension for Generating 24 bit Images
----
Locale-Object-0.74
http://search.cpan.org/~fotango/Locale-Object-0.74/
OO locale information
----
Math-Calc-Units-1.06
http://search.cpan.org/~sfink/Math-Calc-Units-1.06/
Human-readable unit-aware calculator
----
Net-Chat-Daemon-0.3
http://search.cpan.org/~sfink/Net-Chat-Daemon-0.3/
run a daemon that is controlled via instant messaging
----
Net-SDP-0.05
http://search.cpan.org/~njh/Net-SDP-0.05/
Session Description Protocol (rfc2327)
----
SVN-Notify-2.61
http://search.cpan.org/~dwheeler/SVN-Notify-2.61/
Subversion activity notification
----
SVN-Web-0.48
http://search.cpan.org/~nikc/SVN-Web-0.48/
Subversion repository web frontend
----
Sys-SigAction-0.06
http://search.cpan.org/~lbaxter/Sys-SigAction-0.06/
Perl extension for Consistent Signal Handling
----
Test-Litmus-0.03
http://search.cpan.org/~zlipton/Test-Litmus-0.03/
Perl module to submit test results to the Litmus testcase management tool
----
Test-WWW-Selenium-1.03
http://search.cpan.org/~lukec/Test-WWW-Selenium-1.03/
Test applications using Selenium Remote Control
----
Win32-PowerPoint-0.01
http://search.cpan.org/~ishigaki/Win32-PowerPoint-0.01/
helps to convert texts to PP slides
----
Win32-Security-EFS-0.06
http://search.cpan.org/~esskar/Win32-Security-EFS-0.06/
Perl interface to functions that assist in working with EFS (Encrypted File System) under Windows plattforms.
----
XML-Filter-RemoveEmpty-0.01
http://search.cpan.org/~kulp/XML-Filter-RemoveEmpty-0.01/
Filter out tags with no character data
----
XML-Liberal-0.12
http://search.cpan.org/~miyagawa/XML-Liberal-0.12/
Super liberal XML parser that parses broken XML
----
XML-RSS-LibXML-0.22
http://search.cpan.org/~dmaki/XML-RSS-LibXML-0.22/
XML::RSS with XML::LibXML
----
cwd
http://search.cpan.org/~vidul/cwd/
Perl pragma to change the current working directory
----
v6-pugs-0.002
http://search.cpan.org/~fglock/v6-pugs-0.002/
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: 28 Jun 2006 18:13:11 -0700
From: "janicehwang1325@yahoo.com" <janicehwang1325@yahoo.com>
Subject: Re: Problem with Multi- threaded Server
Message-Id: <1151543591.314934.85540@d56g2000cwd.googlegroups.com>
Thanks for the information. I will try to find the bug out and trying
to search for the information for stunnel program. Thank you very much.
Any result will be shared later.
Ted Zlatanov wrote:
> On 27 Jun 2006, janicehwang1325@yahoo.com wrote:
>
> > For your information, I am running my program in FreeBSD(should have
> > mention earlier, sorry bout this) and connect to the FreeBSD using SSH.
> > Therefore, I don't think I can use "stunnel" program for it.
>
> Are you sure `stunnel' is not available on FreeBSD? I find that very
> susprising. I don't have a FreeBSD machine available, but as far as I
> know FreeBSD is pretty good about general Unix compatibility, and is
> one of the major Unix OSs.
>
> You may have to run stunnel as root, IF the port you want to use is
> privileged (usually that means it's less than 1024 in a Unix
> environment). But otherwise you don't need to be root, so you can run
> stunnel as yourself, say on port 5643, and forward to your server that
> runs without SSL on port 5642 (the ports can be any unused port number
> above 1024). This can be done like this:
>
> stunnel -d 5643 -r 5642 [OPTIONS]
>
> I won't give you any more information here, because it's off-topic for
> a Perl newsgroup. You should visit the stunnel home page and read the
> documentation if you have more questions, especially about the other
> options stunnel takes.
>
> Ted
------------------------------
Date: 28 Jun 2006 20:50:46 -0700
From: "it_says_BALLS_on_your_forehead" <simon.chao@gmail.com>
Subject: Re: Scalable method for searching in relatively big files
Message-Id: <1151553046.357486.237520@m73g2000cwd.googlegroups.com>
Tad McClellan wrote:
> it_says_BALLS_on_your forehead <simon.chao@fmr.com> wrote:
> > Tad McClellan wrote:
> >> it_says_BALLS_on_your forehead <simon.chao@fmr.com> wrote:
>
> >> > From the Programming Perl 3rd ed. book
> >> > pg. 63...
>
>
> >> Please don't cite a resource with limited distribution when there
> >> is a widely available resource that says the same thing (perlop.pod).
>
> > I see nothing wrong with citing one of the definitive Perl reference
> > books when I provide the quote.
>
>
> I see at least 2 reasons.
>
> The primary reason is that everybody has the docs that come with perl
> and not everybody has bought the Camel book, so more people can
> participate freely, which seems desirable and open-sourcey.
>
> The 2nd reason is that those who haven't paid O'Reilly cannot go
> see the context of the quote. There is nothing in the quote that
> indicates that is is talking about m// delimiters, it might be
> talking about qq// delimiters for all we can tell.
You're certainly tenacious. Very well, I acquiesce :-).
------------------------------
Date: 29 Jun 2006 02:18:26 -0700
From: "KaZ" <kaz219@gawab.com>
Subject: Re: Scalable method for searching in relatively big files
Message-Id: <1151572706.053694.53280@d56g2000cwd.googlegroups.com>
Brian Wakem wrote:
> KaZ wrote:
>
> > Hi,
> >
> > I want to do this:
> >
> > I have a file A (the file size can be up to around 40MB, I know it
> > isn't that big), and I have to read it one line after the other (I use
> > a while loop for this), and possibly print something into file B,
> > depending on what is in the line. In each iteration, I have to search
> > the file A for pattern and the file B to check what has been already
> > written in it.
> >
> > Right now, I made the searches with arrays and grep. I put the whole
> > file A in an array (array @a), file B is an empty array (array @b) at
> > the beginning, and at the end I write the array @b into file B. I read
> > directly in the file A each line for the while loop, because I feared
> > it would interfer with the search if I used the array @a for the while
> > loop also.
> >
> > The file A is for the moment only 4MB, and the script take 10 minutes
> > to complete. So it isn't a scalable solution in my opinion.
> >
> > I was told to use database or possibly tied hashes, in order to get
> > more scalability.
> >
> > Can anybody tell me a bit more about this two methods? I read what a
> > hash is, but fail to see how it could help me.
> >
> > Greetings,
>
>
> As David has said, you need to show us some code.
>
> Usually replacing regexs with index (where it can be used) will give a big
> performance increase. I doubt it needs to take 10 minutes, or even 10
> seconds.
>
>
> --
> Brian Wakem
> Email: http://homepage.ntlworld.com/b.wakem/myemail.png
Hello,
I changed grep for index, but it didn't speed up (actually it is taking
exactly the same amount of time). Maybe because it wasn't real regexes,
only strings like /\t$var\t/
Using a hash instead of reading the excel file everytime made a
noticeable speed increase, but it is still lasting more than 5 min.
Anyway, thanks a lot for this advice.
------------------------------
Date: Thu, 29 Jun 2006 04:52:50 GMT
From: Alexander Huber <alhuber@gmx.net>
Subject: Re: short-hand for same regex for multiple scalars?
Message-Id: <C0Jog.13696$IU2.4706@newsfe2-win.ntli.net>
Many thanks! :-)
Alexander.
John W. Krahn wrote:
> Paul Lalli wrote:
>> Alexander Huber wrote:
>>> Is there a shorter way of writing the following (regex only once on
>>> right-hand side?), basically I want to apply the same regular expression
>>> consecutively to multiple scalars:
>>>
>>> $a =~ s/a/b/gs;
>>> $b =~ s/a/b/gs;
>>> $c =~ s/a/b/gs;
>>>
>> Why not just use a loop?
>>
>> for my $var ($a, $b, $c) {
>> $var =~ s/a/b/gs;
>> }
>
> Since the OP wants a shorter way:
>
> s/a/b/g for $a, $b, $c;
>
>
> :-)
>
> John
--
Alexander Huber
mailto:alhuber@gmx.net
------------------------------
Date: 28 Jun 2006 23:47:20 -0700
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: short-hand for same regex for multiple scalars?
Message-Id: <1151563640.469370.101150@m73g2000cwd.googlegroups.com>
John W. Krahn wrote:
> > Alexander Huber wrote:
> >>Is there a shorter way of writing the following (regex only once on
> >>right-hand side?), basically I want to apply the same regular expression
> >>consecutively to multiple scalars:
> >>
> >>$a =~ s/a/b/gs;
> >>$b =~ s/a/b/gs;
> >>$c =~ s/a/b/gs;
>
> s/a/b/g for $a, $b, $c;
It should also be noted that the very fact that the OP wants to perform
idenitical processing on several scalar values means he should consider
putting them in a agregate data type rather than separately named
scalars.
s/a/b/g for values %some_hash;
------------------------------
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 9405
***************************************