[32489] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3754 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 8 18:09:21 2012

Date: Wed, 8 Aug 2012 15:09:06 -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           Wed, 8 Aug 2012     Volume: 11 Number: 3754

Today's topics:
    Re: a regex for removing a password in a source listing (Tim McDaniel)
    Re: Click in a radio button <justin.1207@purestblue.com>
        dynamic content with PDF::API2 <cartercc@gmail.com>
        How to debug a regex with (?DEFINE)? <pengyu.ut@gmail.com>
        i18n for netnews / Gen X vs. Netnews <oneingray@gmail.com>
    Re: i18n for netnews / Gen X vs. Netnews (Seymour J.)
    Re: i18n for netnews / Gen X vs. Netnews <oneingray@gmail.com>
    Re: i18n for netnews / Gen X vs. Netnews (Seymour J.)
    Re: Linux, IO::Socket::INET and recv'ing broadcasted UD mkparam@gmail.com
    Re: Man, has this newsgroup shrunk.  Why?  Where gone t <xhoster@gmail.com>
    Re: Man, has this newsgroup shrunk.  Why?  Where gone t <justin.1207@purestblue.com>
    Re: Man, has this newsgroup shrunk.  Why?  Where gone t (Seymour J.)
        Unexplained delay Module::Build + ExtUtils::MakeMaker b <klaus03@gmail.com>
    Re: Unexplained delay Module::Build + ExtUtils::MakeMak <klaus03@gmail.com>
        Using variable in replacement expression <rob@sypron.nl>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 7 Aug 2012 16:01:06 +0000 (UTC)
From: tmcd@panix.com (Tim McDaniel)
Subject: Re: a regex for removing a password in a source listing
Message-Id: <jvre42$b1l$1@reader1.panix.com>

In article <501e3146$0$6558$9b4e6d93@newsspool4.arcor-online.net>,
Wolf Behrenhoff  <nospampleasebutthisisvalid3@gmx.net> wrote:
>On 05.08.2012 02:14, Cal Dershowitz wrote:
>> Proper arrays are lists, so this is counterexample:
>
>No. In Perl, lists and arrays are different. An array is not a list.
>perldoc -q "What is the difference between a list and an array"

    $ perldoc -q "What is the difference between a list and an array"
    No documentation for perl FAQ keyword `What is the difference
    between a list and an array' found

    $ perl -v

    This is perl 5, version 14, subversion 2 (v5.14.2) built for
    i386-netbsd

http://search.cpan.org/~flora/perl-5.14.2/pod/perlfaq4.pod#What_is_the_difference_between_a_list_and_an_array?
works.

While it's a true statement and people should know that there's a
difference and sometimes it matters, I used Perl for many years
thinking that lists and arrays were the same and didn't get bit by it.
Even just rereading that FAQ entry, I may be still a bit fuzzy.

I think the main thing to remember from that FAQ is that comma can
mean two things

    Binary "," is the comma operator.  In scalar context it evaluates
    its left argument, throws that value away, then evaluates its
    right argument and returns that value.  This is just like C's
    comma operator.

    In list context, it's just the list argument separator, and
    inserts both its arguments into the list.  These arguments are
    also evaluated from left to right.
                         
So be careful of comma-separated things: know what context they're
being used in.

-- 
Tim McDaniel, tmcd@panix.com


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

Date: Tue, 7 Aug 2012 15:10:59 +0100
From: Justin C <justin.1207@purestblue.com>
Subject: Re: Click in a radio button
Message-Id: <j8k7f9-3e4.ln1@zem.masonsmusic.co.uk>

On 2012-08-07, contracer <contracer11@gmail.com> wrote:
> Hi,
> I'm a newbee in Perl, and I'd like know if I can click specific radio
> button in a web page with Perl.
> This page haves 30 radio buttons.  This page is made in Javascript,
> and I can't see tags in source code,
> but looking in the web page all buttons haves names.
> Thanks.


Search CPAN for WWW::Mechanize.

   Justin.

-- 
Justin C, by the sea.


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

Date: Wed, 8 Aug 2012 13:27:58 -0700 (PDT)
From: ccc31807 <cartercc@gmail.com>
Subject: dynamic content with PDF::API2
Message-Id: <c163156b-4623-4e69-8a58-48326dfcdcfa@googlegroups.com>

I've been using PDF::API2 for years without a problem of any kind, but now have a new requirement -- text wrapping. Here's an example:

#from a hashref from a database, name could be NULL
my $name = $hashref->{$key}{name};
my $sentence = '';
$sentence = "Hello, my name is $name." if $name;

#in PDF code
$text->text("Greetings. $sentence Here is some information.");

This works if $name is NULL, because $sentence takes up no space and the end result contains two spaces after the greeting, which isn't a big deal.

However, there's a big difference between 'Ed' and 'Barack Hussein Obama.' The longer names cause the line to run off the right margin.

Is it possible to wrap text in PDF::API2? I've looked and can't see how.

I could write my own wrapping routine, but would rather not.

I also don't want to use another module (maybe CAM::PDF) but would rather not, and I haven't looked at the other modules to see if they can wrap text.

Thanks, CC.


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

Date: Tue, 7 Aug 2012 10:29:21 -0700 (PDT)
From: Peng Yu <pengyu.ut@gmail.com>
Subject: How to debug a regex with (?DEFINE)?
Message-Id: <a1fc749c-2ba2-49cc-b40a-e05ee963ead7@z11g2000yqa.googlegroups.com>

Hi,

I'm trying to extract the nested namespace in the following code. But
the code can only extract the inner namespace. It is very hard for me
to see what is wrong. Does anybody know some tricks how to debug a
regex like the following? Thanks!

~/linux/test/perl/man/perlre/(?/(/DEFINE$ cat
main_namespace_multiple.pl
#!/usr/bin/env perl

use strict;
use warnings;

my $text=<<'EOF';
namespace A {
  namespace B {
  }
}
EOF

# Build pattern that matches only namespaces...
my $namespace_pattern = qr{
    ((?&namespace))        # Match and capture (possibly nested)
namespace

    # Define each component...
    (?(DEFINE)
        (?<namespace_token>
          \b [A-Za-z_]\w* \b
        )

        (?<namespace_keyword>
            \b namespace \b
        )

        # Namespace is keyword + name + block...
        (?<namespace>
            (?&namespace_keyword) \s+ (?&namespace_token) \s*
            \{
            (?&namespace_body)
            \}
        )

        (?<namespace_body>
            (?:
              \s*
              (?&namespace)
              \s*
            )
            |
            (?&block)
        )

        (?<block>
            \{
                (?: (?&block) | . )*?
            \}
        )
    )
}xs;

my ($extracted) = $text =~ $namespace_pattern;

print "text = $text\n";
print "extracted = $extracted\n";


Regards,
Peng


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

Date: Wed, 08 Aug 2012 17:13:09 +0700
From: Ivan Shmakov <oneingray@gmail.com>
Subject: i18n for netnews / Gen X vs. Netnews
Message-Id: <86obmlk7yi.fsf_-_@gray.siamics.net>

>>>>> Shmuel (Seymour J ) Metz <spamtrap@library.lspace.org.invalid> writes:
>>>>> In <866292skzv.fsf_-_@gray.siamics.net>, Ivan Shmakov said:

	[Cross-posting to news:comp.mail.misc, just in case; dropping
	news:comp.lang.perl.misc from Followup-To:.]

 >> As of RFC 5536 (published November 2009), it's /allowed/ to use
 >> national characters in Netnews article headers, /provided/ that
 >> RFC 2047 is used to encode them in 7-bit ASCII.

 > Yes, but compare that to what is going on with e-mail; the
 > experimental RFC 5335, allowing raw UTF-8 in headers, has been
 > replaced by a standard track RFC, 6532.

	ACK, thanks for the pointer!

 > While RFC 3977 provides an equivalent to 8BITMIME, there is no
 > netnews equivalent to SMTPUTF8, and I'm predicting that there will
 > eventually be one.

	So, I should be prepared to allow both pure-ASCII /and/ UTF-8.
	It's still better than allowing an arbitrary octet sequence in
	an unspecified encoding in the header.

 > BTW, I interpreted your "non-ASCII" as referring to octets beyond
 > 127, rather than to ASCII encoding of non-ASCII data.

	Indeed, it's exactly what I've meant.

PS.  Still, I believe that while the systems of the days passed
	warranted a separation between Netnews /Transfer/ Agents (BKA
	NNTP "servers", though it's a bit a misnomer) and Netnews /User/
	Agents (NNTP "clients"; and, similarly, between Mail Transfer
	Agents and Mail User Agents), the performance of the modern
	computers, along with the reasonable success of the contemporary
	P2P systems, makes it possible to get rid of such a distinction,
	and allow for a direct "user-to-user" communication, in both a
	Netnews- and Mail-like fashion.  Perhaps, such an approach would
	be more in line with the "Gen X" habits?

-- 
FSF associate member #7257	http://sf-day.org/


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

Date: Wed, 08 Aug 2012 08:27:21 -0400
From: Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid>
Subject: Re: i18n for netnews / Gen X vs. Netnews
Message-Id: <50225b29$7$fuzhry+tra$mr2ice@news.patriot.net>

In <86obmlk7yi.fsf_-_@gray.siamics.net>, on 08/08/2012
   at 05:13 PM, Ivan Shmakov <oneingray@gmail.com> said:

>So, I should be prepared to allow both pure-ASCII /and/ UTF-8.

Prepared in the sense of having a flag with initial value false that,
if set, will permit non-ASCII.

>PS.  Still, I believe that while the systems of the days passed
>	warranted a separation between Netnews /Transfer/ Agents (BKA
>	NNTP "servers", though it's a bit a misnomer) and Netnews /User/
>	Agents (NNTP "clients"; and, similarly, between Mail Transfer
>	Agents and Mail User Agents), the performance of the modern
>	computers, along with the reasonable success of the contemporary
>	P2P systems, makes it possible to get rid of such a distinction,
>	and allow for a direct "user-to-user" communication, in both a
>	Netnews- and Mail-like fashion.  Perhaps, such an approach would
>	be more in line with the "Gen X" habits?

I don't agree; I like being able to work offline and I like not having
to use bloated web intefraces. Further, there are security issues.

-- 
Shmuel (Seymour J.) Metz, SysProg and JOAT  <http://patriot.net/~shmuel>

Unsolicited bulk E-mail subject to legal action.  I reserve the
right to publicly post or ridicule any abusive E-mail.  Reply to
domain Patriot dot net user shmuel+news to contact me.  Do not
reply to spamtrap@library.lspace.org



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

Date: Wed, 08 Aug 2012 21:13:16 +0700
From: Ivan Shmakov <oneingray@gmail.com>
Subject: Re: i18n for netnews / Gen X vs. Netnews
Message-Id: <86sjbxii9v.fsf@gray.siamics.net>

>>>>> Shmuel (Seymour J ) Metz <spamtrap@library.lspace.org.invalid> writes:
>>>>> In <86obmlk7yi.fsf_-_@gray.siamics.net>, Ivan Shmakov said:

	[Still wondering why news:comp.lang.perl.misc wasn't dropped.]

 >> So, I should be prepared to allow both pure-ASCII /and/ UTF-8.

 > Prepared in the sense of having a flag with initial value false that,
 > if set, will permit non-ASCII.

	... to permit UTF-8 (or anything that could be interpreted as
	that) in the header, not just arbitrary binary data.  (Binary
	data will be allowed for the body, subject to the relevant
	restrictions, and provided that Content-Transfer-Encoding: is
	present and has "8bit" as its value.)

 >> PS.  Still, I believe that while the systems of the days passed
 >> warranted a separation between Netnews /Transfer/ Agents (BKA NNTP
 >> "servers", though it's a bit a misnomer) and Netnews /User/ Agents
 >> (NNTP "clients"; and, similarly, between Mail Transfer Agents and
 >> Mail User Agents), the performance of the modern computers, along
 >> with the reasonable success of the contemporary P2P systems, makes
 >> it possible to get rid of such a distinction, and allow for a direct
 >> "user-to-user" communication, in both a Netnews- and Mail-like
 >> fashion.  Perhaps, such an approach would be more in line with the
 >> "Gen X" habits?

 > I don't agree; I like being able to work offline

	After the data is downloaded from a P2P network (it may be
	BitTorrent, GNUnet, Freenet, or whatever else), it could be used
	off-line just perfectly.

 > and I like not having to use bloated web intefraces.

	There're P2P agents with almost whatever interface: CLI,
	full-screen text, graphical, Web, XML-RPC, etc.

	(Not to mention that the contemporary Web is anything but a P2P
	network.)

 > Further, there are security issues.

	Namely?  Freenet, GNUnet and Tor networks seem to have an
	explicit focus on security, while BitTorrent's metadata (both
	.torrent and Metalink) may be protected by digital signatures
	(OpenPGP will work for either; Metalink should support XMLDSig,
	too.)

-- 
FSF associate member #7257	http://sf-day.org/


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

Date: Wed, 08 Aug 2012 13:18:25 -0400
From: Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid>
Subject: Re: i18n for netnews / Gen X vs. Netnews
Message-Id: <50229f61$9$fuzhry+tra$mr2ice@news.patriot.net>

In <86sjbxii9v.fsf@gray.siamics.net>, on 08/08/2012
   at 09:13 PM, Ivan Shmakov <oneingray@gmail.com> said:

>	After the data is downloaded from a P2P network (it may be
>	BitTorrent, GNUnet, Freenet, or whatever else), it could be used
>	off-line just perfectly.

Do those have the routing capabilities that mail and news require?
Also, wouldn't you still have a sparation betwen a user agent and a
transfer agent?

>	Namely?

E.g., audit trail of the route for mail.

-- 
Shmuel (Seymour J.) Metz, SysProg and JOAT  <http://patriot.net/~shmuel>

Unsolicited bulk E-mail subject to legal action.  I reserve the
right to publicly post or ridicule any abusive E-mail.  Reply to
domain Patriot dot net user shmuel+news to contact me.  Do not
reply to spamtrap@library.lspace.org



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

Date: Tue, 7 Aug 2012 04:51:42 -0700 (PDT)
From: mkparam@gmail.com
Subject: Re: Linux, IO::Socket::INET and recv'ing broadcasted UDP
Message-Id: <976ec85e-d9cc-4cab-9274-4b2095836c81@googlegroups.com>

I am back again. I upgraded the dhcp server to 4.1.11 on RHEL6 and the LEAS=
EQUERY works great now.

perl inform.pl 192.168.1.2 192.168.1.14
marshall: packet too small (286), minimum size is 300 at inform.pl line 34
op =3D BOOTREPLY
htype =3D HTYPE_ETHER
hlen =3D 6
hops =3D 0
xid =3D 95aba24
secs =3D 0
flags =3D 0  =20
ciaddr =3D 192.168.1.14
yiaddr =3D 0.0.0.0
siaddr =3D 0.0.0.0
giaddr =3D 192.168.1.3
chaddr =3D 005056aabbcc
sname =3D
file =3D
Options :
 DHO_DHCP_MESSAGE_TYPE(53) =3D DHCPLEASEACTIVE
 DHO_DHCP_SERVER_IDENTIFIER(54) =3D 192.168.1.2
 DHO_DHCP_LEASE_TIME(51) =3D 1531
 DHO_SUBNET_MASK(1) =3D 255.255.255.0
 DHO_ROUTERS(3) =3D 192.168.1.0
 DHO_DHCP_RENEWAL_TIME(58) =3D 31
 DHO_DHCP_REBINDING_TIME(59) =3D 1156
 DHO_CLIENT_LAST_TRANSACTION_TIME(91) =3D \x00\x00\x05\xBD
padding [0] =3D

Interestingly, I am unable to RENEW that IP to extend the lease. I am still=
 to crack this. If i can achieve the RENEW and RELEASE methods, i am all do=
ne since i would be able to successfully mimic the end-to-end dhcp cycle so=
 that my script can handle whatever is required according to the scenario. =
Any pointers ? DHCPRENEW is not accepted DHCP message type, and i found DHC=
PFORCERENEW is, but it fails, may be i am yet to understand how i must pass=
 that to the server. Let me know if you guys have tried this before ? Thank=
s.


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

Date: Tue, 07 Aug 2012 20:55:51 -0700
From: Xho Jingleheimerschmidt <xhoster@gmail.com>
Subject: Re: Man, has this newsgroup shrunk.  Why?  Where gone to?
Message-Id: <5021f274$0$20999$ed362ca5@nr5-q3a.newsreader.com>

On 07/31/2012 02:36 PM, David Combs wrote:
> It's fairly obvious that this group has really shrunk over
> the last year or so.
>
> So, what's up?

Most of the traffic was generated by inexperienced people asking 
questions and ensuing answers and discussions.  Now inexperienced people 
are unlikely to use newsgroups.  And the old-timers left just don't have 
all that much to say to each other.

 From what I can tell, the groups that haven't shrunk tremendously are 
the ones of a nature where the old times can keep discovering new things 
to yack about, or just keep yacking about the same old things forever 
(i.e. politics, trolls).  Of course the sample of groups I attempt to 
follow is probably not large enough to be statistically significant.

>
> Surely, perl usage isn't down.
>
> So where are the problems and answers (via perl-answer gurus)
> operating from now?  Some web site?

Yeah.  There is perlmonks that I know of, and a few more I run into 
occasionally but can't remember until I run into them again and 
recognize them.

> (Because gen-x doesn't
> like newsgroups?)

Like it?  They mostly aren't even aware it exists.

And Google's ever-increasing crappification of their interface surely 
doesn't help.  It is hard to tell what is less usable, their search 
interface or their posting interface.  It is amazing how an otherwise 
good company can so systematically screw up this one area with such 
consistency, intensity, and vigor.

Xho


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

Date: Wed, 8 Aug 2012 12:01:11 +0100
From: Justin C <justin.1207@purestblue.com>
Subject: Re: Man, has this newsgroup shrunk.  Why?  Where gone to?
Message-Id: <ngt9f9-1om.ln1@zem.masonsmusic.co.uk>

On 2012-08-08, Xho Jingleheimerschmidt <xhoster@gmail.com> wrote:

[snip]

> It is amazing how an otherwise 
> good company can so systematically screw up this one area with such 
> consistency, intensity, and vigor.

<aol>me too</aol>


   Justin.

-- 
Justin C, by the sea.


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

Date: Wed, 08 Aug 2012 08:48:42 -0400
From: Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid>
Subject: Re: Man, has this newsgroup shrunk.  Why?  Where gone to?
Message-Id: <5022602a$8$fuzhry+tra$mr2ice@news.patriot.net>

In <5021f274$0$20999$ed362ca5@nr5-q3a.newsreader.com>, on 08/07/2012
   at 08:55 PM, Xho Jingleheimerschmidt <xhoster@gmail.com> said:

>And Google's ever-increasing crappification of their interface 
>surely doesn't help.  It is hard to tell what is less usable, 
>their search interface or their posting interface.  It is amazing 
>how an otherwise good company can so systematically screw up this 
>one area with such consistency, intensity, and vigor.

Perhaps you need to reexamine your assumption that they are otherwise
good.

-- 
Shmuel (Seymour J.) Metz, SysProg and JOAT  <http://patriot.net/~shmuel>

Unsolicited bulk E-mail subject to legal action.  I reserve the
right to publicly post or ridicule any abusive E-mail.  Reply to
domain Patriot dot net user shmuel+news to contact me.  Do not
reply to spamtrap@library.lspace.org



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

Date: Wed, 8 Aug 2012 11:15:28 -0700 (PDT)
From: Klaus <klaus03@gmail.com>
Subject: Unexplained delay Module::Build + ExtUtils::MakeMaker building pure perl modules
Message-Id: <11ea63c3-ffb3-47c4-a128-9665ac92bbeb@w14g2000vbx.googlegroups.com>

On 12 nov, 15:44, Klaus <klau...@gmail.com> wrote:
> I am having a problem when building pure perl modules
> on Windows 7, ActiveState Perl 5.12.3.
>
> The module build / test / install works correctly, but
> my issue is that the build process for a very simple
> pure perl module (Acme::SList::Utilities in this case)
> takes about 60 seconds on my Windows machine. The
> Build test and Build install process work rapidly
> in about 2 seconds each.

I have experimented with Strawberry Perl on Windows 7 (first a 'Build
clean', then a 'Build') and I can report no delay in building a pure
perl module (Acme::SList::Utilities, takes 2 seconds with Strawberry
Perl on my Windows 7 machine).

So I installed ActiveState Perl back on Windows 7, and, voila, after a
'Build clean', followed by a 'Build', the build process is back to 60
seconds.

> C:\Acme-SList-Utilities-0.01>Build clean
> Set up gcc environment - 3.4.5 (mingw-vista special r3)
> Set up gcc environment - 3.4.5 (mingw-vista special r3)
> Set up gcc environment - 3.4.5 (mingw-vista special r3)
> Cleaning up build files
>
> Yes, a Build clean actually makes it go back to taking a
> long time again.
>
> C:\Acme-SList-Utilities-0.01>Build --verbose
> Set up gcc environment - 3.4.5 (mingw-vista special r3)
> Set up gcc environment - 3.4.5 (mingw-vista special r3)
> Set up gcc environment - 3.4.5 (mingw-vista special r3)
> Building Acme-SList-Utilities
> Copying lib\Acme\SList\Utilities.pm -> blib\lib\Acme
> \SList\Utilities.pm
> Manifying blib\lib/Acme/SList/Utilities.pm -> blib
> \libdoc\Acme.SList.Utilities.3
> Converting Pod to HTML with ActiveState::DocTools::Pod
> HTMLifying blib\lib\Acme\SList\Utilities.pm -> blib\
> libhtml\site\lib\Acme\SList\Utilities.html
>
> ** It's actually the HTMLifying step which takes such a
> long time.
>
> I suspect that the HTMLifying step of the Build actually
> crawls the filesystem (or even worse, goes out on the
> net to verify external links)

To get to the bottom of this, I drilled into the ActiveState modules
and I found that the following single call to Pod::Simple::Search in
ActivePerl/DocTools/Pod.pm, subroutine pod2html() is the reason for
the slowdown:

>> ============================================
>> unless (get_cache($Dircache, \@Podpath, $Podroot,
>> $Recurse)) {
>>    # generate %Pages
>>    my $pwd = getcwd();
>>    chdir($Podroot) ||
>>      die "$0: error changing to directory ...";
>>
>>    # find all pod modules/pages in podpath, store...
>>    # - callback used to remove Podroot and...
>>    # - laborious to allow '.' in dirnames (e.g., ...
>>
>>    Pod::Simple::Search->new->inc(0)
>>      ->verbose($Verbose)
>>      ->laborious(1)->callback(\&_save_page)
>>      ->recurse($Recurse)->survey(@Podpath);
>> ============================================

This call (Pod::Simple::Search) consumes 58 seconds on my machine.
It's purpose is to crawl all perl directories,
identify *.pm files and populate an index of all modules with their
respective location on disk. It is that index
which later allows the podfile to replace the pod directive
L<Mod::Name> by <a href="C:\Perl\scite\lib\Mod\Name.pm">.

Let's say that I am not particularly interested in that feature which
translates pod directives L<...> into <a href="...">. In this case, I
can simply comment out the call to Pod::Simple::Search in ActivePerl/
DocTools/Pod.pm.

Now, even with ActiveState Perl, I am back to 2 seconds for a 'Build
clean' + 'Build'. Of course, I have lost the
fancy <a href="..."> for the L<...> constructions, but I consider this
a small price to pay for the 58 seconds that
I have gained with 'Build clean' + 'Build'.

What is particularly interesting is that I now can use App::cpanminus,
without that annoying delay of 58 seconds
for each module to be installed.

The question I have is as follows: The commenting out of the call to
Pod::Simple::Search in ActivePerl/DocTools/Pod.pm works fine for my
system, but I would like to have a more flexible solution (probably
triggered by an environment variable $ENV{'ASPERL_INDEX'} = 'off') as
follows:

>> ============================================
>> unless (get_cache($Dircache, \@Podpath, $Podroot,
>> $Recurse)) {
>>    # generate %Pages
>>    my $pwd = getcwd();
>>    chdir($Podroot) ||
>>      die "$0: error changing to directory ...";
>>
>>    # find all pod modules/pages in podpath, store...
>>    # - callback used to remove Podroot and...
>>    # - laborious to allow '.' in dirnames (e.g., ...
>>
>>    unless (defined($ENV{'ASPERL_INDEX'})
>>    and $ENV{'ASPERL_INDEX'} eq 'off') {
>>        Pod::Simple::Search->new->inc(0)
>>          ->verbose($Verbose)
>>          ->laborious(1)->callback(\&_save_page)
>>          ->recurse($Recurse)->survey(@Podpath);
>>    }
>> ============================================

Do you think that this is a good solution ?

Where can I speak to ActiveState to propose my changes to be
incorporated into their development branch ?


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

Date: Wed, 8 Aug 2012 13:39:08 -0700 (PDT)
From: Klaus <klaus03@gmail.com>
Subject: Re: Unexplained delay Module::Build + ExtUtils::MakeMaker building pure perl modules
Message-Id: <90b0d1a7-c038-4119-ba6d-fe756b7b30b5@h5g2000vbl.googlegroups.com>

On 8 ao=FBt, 20:15, Klaus <klau...@gmail.com> wrote:
> On 12 nov, 15:44, Klaus <klau...@gmail.com> wrote:
> > ** It's actually the HTMLifying step which takes such a
> > long time.
>
> > I suspect that the HTMLifying step of the Build actually
> > crawls the filesystem (or even worse, goes out on the
> > net to verify external links)
>
> To get to the bottom of this, I drilled into the ActiveState modules
> and I found that the following single call to Pod::Simple::Search in
> ActivePerl/DocTools/Pod.pm, subroutine pod2html() is the reason for
> the slowdown:

Sorry, my bad. The call to Pod::Simple::Search takes place in Pod/
Html.pm and *not* in ActivePerl/DocTools/Pod.pm.

> Let's say that I am not particularly interested in that feature which
> translates pod directives L<...> into <a href=3D"...">. In this case, I
> can simply comment out the call to Pod::Simple::Search in ActivePerl/
> DocTools/Pod.pm.

Again, my bad, the call was commented out in Pod/Html.pm and *not* in
ActivePerl/DocTools/Pod.pm.

> Now, even with ActiveState Perl, I am back to 2 seconds for a 'Build
> clean' + 'Build'. Of course, I have lost the
> fancy <a href=3D"..."> for the L<...> constructions, but I consider this
> a small price to pay for the 58 seconds that
> I have gained with 'Build clean' + 'Build'.
>
> What is particularly interesting is that I now can use App::cpanminus,
> without that annoying delay of 58 seconds
> for each module to be installed.
>
> The question I have is as follows: The commenting out of the call to
> Pod::Simple::Search in ActivePerl/DocTools/Pod.pm works fine for my

Again, my bad, the call was commented out in Pod/Html.pm and *not* in
ActivePerl/DocTools/Pod.pm.

> system, but I would like to have a more flexible solution (probably
> triggered by an environment variable $ENV{'ASPERL_INDEX'} =3D 'off') as
> follows:
>
> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> >> unless (get_cache($Dircache, \@Podpath, $Podroot,
> >> $Recurse)) {
> >> =A0 =A0# generate %Pages
> >> =A0 =A0my $pwd =3D getcwd();
> >> =A0 =A0chdir($Podroot) ||
> >> =A0 =A0 =A0die "$0: error changing to directory ...";
>
> >> =A0 =A0# find all pod modules/pages in podpath, store...
> >> =A0 =A0# - callback used to remove Podroot and...
> >> =A0 =A0# - laborious to allow '.' in dirnames (e.g., ...
>
> >> =A0 =A0unless (defined($ENV{'ASPERL_INDEX'})
> >> =A0 =A0and $ENV{'ASPERL_INDEX'} eq 'off') {
> >> =A0 =A0 =A0 =A0Pod::Simple::Search->new->inc(0)
> >> =A0 =A0 =A0 =A0 =A0->verbose($Verbose)
> >> =A0 =A0 =A0 =A0 =A0->laborious(1)->callback(\&_save_page)
> >> =A0 =A0 =A0 =A0 =A0->recurse($Recurse)->survey(@Podpath);
> >> =A0 =A0}
> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
> Do you think that this is a good solution ?

Answering my own question: I don't think this is a good solution.

> Where can I speak to ActiveState to propose my changes to be
> incorporated into their development branch ?

Before I speak to ActiveState I will first investigate further.


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

Date: Wed, 8 Aug 2012 14:25:27 -0700 (PDT)
From: RobV <rob@sypron.nl>
Subject: Using variable in replacement expression
Message-Id: <141389db-09e3-43de-89c5-e8cb9ce8abeb@googlegroups.com>

I'm trying to do a global replace with a varying replacement string which includes a counter to count the replacements. 
The idea is this (replacing all "xy" strings):
   Source: "ab xy cd xy ef xy gh"
   Result: "ab Mark1 cd Mark2 ef Mark3 gh"

I read through perlre and the best I can come up with is below. Yet it doesn't do what I wanted, the replacement is identical every time:

$cnt = 1;
$replace = '"Mark$cnt"';
$s = "ab xy cd xy ef xy gh";

while ($s =~ s/xy/$replace/gee) { 
	  $cnt++;
}
print $s;

Result is: "ab Mark1 cd Mark1 ef Mark1 gh"

My understanding of the /ee modifier is that it forces the right-hand side to be evaluated every time, but somewhere in my understanding something seems to be missing. 

I'd be grateful if someone could point me the way.
Thanks in advance, 

Rob V.


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

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:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#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 V11 Issue 3754
***************************************


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