[30423] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1666 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jun 22 03:09:42 2008

Date: Sun, 22 Jun 2008 00:09:07 -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           Sun, 22 Jun 2008     Volume: 11 Number: 1666

Today's topics:
    Re: code review request <noreply@gunnar.cc>
    Re: code review request <stefan.petrea@gmail.com>
        Difference of * and + in regular expression <PengYu.UT@gmail.com>
    Re: Difference of * and + in regular expression <noreply@gunnar.cc>
    Re: Difference of * and + in regular expression <someone@example.com>
    Re: Difference of * and + in regular expression <PengYu.UT@gmail.com>
    Re: Difference of * and + in regular expression <noreply@gunnar.cc>
        How to make list of all htm file... <pero@tupwerwt.ch>
    Re: How to make list of all htm file... <usenet@davidfilmer.com>
    Re: How to make list of all htm file... <bjoern@hoehrmann.de>
    Re: How to make list of all htm file... <noreply@gunnar.cc>
    Re: How to make list of all htm file... <jurgenex@hotmail.com>
    Re: How to make list of all htm file... <szrRE@szromanMO.comVE>
        ministeri paula  yle-peili:ssä öylön <karlsson@pooling.org>
        new CPAN modules on Sun Jun 22 2008 (Randal Schwartz)
    Re: Substituting in a group <daveb@addr.invalid>
    Re: Substituting in a group <daveb@addr.invalid>
    Re: Tosi epäselvä raitiovaunukolarin syy. <niklas@naki.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 21 Jun 2008 21:20:11 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: code review request
Message-Id: <6c52jgF3dhieaU1@mid.individual.net>

SPX2 wrote:
> ... when I use another server-side script,this one
> http://perlhobby.googlecode.com/svn/trunk/firefox_toolbar_version_0.5/get_data.pl
> it stops working. ...

That's a useless problem description. Please let us know
- expected output,
- the output you get, and
- which error messages you get

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Sat, 21 Jun 2008 12:55:49 -0700 (PDT)
From: SPX2 <stefan.petrea@gmail.com>
Subject: Re: code review request
Message-Id: <371cd2de-948d-400d-a191-1743bcb44c0c@f36g2000hsa.googlegroups.com>

On 21 Iun, 22:20, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
> SPX2 wrote:
> > ... when I use another server-side script,this one
> >http://perlhobby.googlecode.com/svn/trunk/firefox_toolbar_version_0.5...
> > it stops working. ...
>
> That's a useless problem description. Please let us know
> - expected output,
> - the output you get, and
> - which error messages you get
>
> --
> Gunnar Hjalmarsson
> Email:http://www.gunnar.cc/cgi-bin/contact.pl

Hi,

Thanks for reading
Expected Output:
   an ad at the top which is related to the content of the current
page
Output I get :
   the javascript seems to say that the response from the server side
script
   has only undefined values and I don't get any ad as I've expected.
   this happens despite the fact that I've tested the script alone
with http://../script.pl?keyword=afsaf,asfas
   and it produces the desired xml file
Error messages I get:
   all variables that js gets from parsing the xml produced by the
server side script are said to be undefined


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

Date: Sat, 21 Jun 2008 19:04:04 -0700 (PDT)
From: Peng Yu <PengYu.UT@gmail.com>
Subject: Difference of * and + in regular expression
Message-Id: <989daa23-cd97-4c40-9776-d010edbdf347@z72g2000hsb.googlegroups.com>

Hi,

If I used the uncommented if-statement, I would get no match. If I
used the commend if statement otherwise, I would have the following
string as the output. I'm wondering why the regular expression with *
does not match anything?

 namespace a { namespace b { namespace c {

Thanks,
Peng

$string="a namespace a { namespace b { namespace c { ";

#if ($string =~ /\s*((namespace\s+\w(\w|\d)*\s*\{\s*)+)/) {
if ($string =~ /\s*((namespace\s+\w(\w|\d)*\s*\{\s*)*)/) {
  print "$1\$\n";
}


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

Date: Sun, 22 Jun 2008 04:39:09 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Difference of * and + in regular expression
Message-Id: <6c5sahF3ebf5vU1@mid.individual.net>

Peng Yu wrote:
> If I used the uncommented if-statement, I would get no match.

Not true. $1 is defined, so the regex does match.

> $string="a namespace a { namespace b { namespace c { ";
> 
> #if ($string =~ /\s*((namespace\s+\w(\w|\d)*\s*\{\s*)+)/) {
> if ($string =~ /\s*((namespace\s+\w(\w|\d)*\s*\{\s*)*)/) {
>   print "$1\$\n";
> }

With the * quantifier, the regex seems to behave non-greedy, though.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Sun, 22 Jun 2008 02:40:07 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: Difference of * and + in regular expression
Message-Id: <bYi7k.653$2G6.341@edtnps83>

Peng Yu wrote:
> Hi,
> 
> If I used the uncommented if-statement, I would get no match. If I
> used the commend if statement otherwise, I would have the following
> string as the output. I'm wondering why the regular expression with *
> does not match anything?

It does match, it just doesn't match what you expected it to match.

>  namespace a { namespace b { namespace c {
> 
> Thanks,
> Peng
> 
> $string="a namespace a { namespace b { namespace c { ";
> 
> #if ($string =~ /\s*((namespace\s+\w(\w|\d)*\s*\{\s*)+)/) {
> if ($string =~ /\s*((namespace\s+\w(\w|\d)*\s*\{\s*)*)/) {
>   print "$1\$\n";
> }

$ perl -e'
use re qw/ debug /;

my $string = "a namespace a { namespace b { namespace c { ";

if ($string =~ /\s*((namespace\s+\w(\w|\d)*\s*\{\s*)*)/) {
   print "$1\$\n";
}
'
Compiling REx `\s*((namespace\s+\w(\w|\d)*\s*\{\s*)*)'
size 40 Got 324 bytes for offset annotations.
first at 1
    1: STAR(3)
    2:   SPACE(0)
    3: OPEN1(5)
    5:   CURLYX[0] {0,32767}(37)
    7:     OPEN2(9)
    9:       EXACT <namespace>(13)
   13:       PLUS(15)
   14:         SPACE(0)
   15:       ALNUM(16)
   16:       CURLYM[3] {0,32767}(28)
   20:         BRANCH(22)
   21:           ALNUM(26)
   22:         BRANCH(24)
   23:           DIGIT(26)
   26:         SUCCEED(0)
   27:         NOTHING(28)
   28:       STAR(30)
   29:         SPACE(0)
   30:       EXACT <{>(32)
   32:       STAR(34)
   33:         SPACE(0)
   34:     CLOSE2(36)
   36:     WHILEM[1/2](0)
   37:   NOTHING(38)
   38: CLOSE1(40)
   40: END(0)
minlen 0
Offsets: [40]
         3[1] 1[2] 4[1] 0[0] 37[1] 0[0] 5[1] 0[0] 6[9] 0[0] 0[0] 0[0] 
17[1] 15[2] 18[2] 27[1] 0[0] 20[1] 0[0] 20[1] 21[2] 23[1] 24[2] 26[1] 
0[0] 27[0] 27[0] 30[1] 28[2] 31[2] 0[0] 35[1] 33[2] 36[1] 0[0] 37[0] 
37[0] 38[1] 0[0] 39[0]
Matching REx "\s*((namespace\s+\w(\w|\d)*\s*\{\s*)*)" against "a 
namespace a { namespace b { namespace c { "
   Setting an EVAL scope, savestack=5
    0 <> <a namespace >    |  1:  STAR
                            SPACE can match 0 times out of 2147483647...
   Setting an EVAL scope, savestack=5
    0 <> <a namespace >    |  3:    OPEN1
    0 <> <a namespace >    |  5:    CURLYX[0] {0,32767}
    0 <> <a namespace >    | 36:      WHILEM[1/2]
                                 0 out of 0..32767  cc=bfa0d330
   Setting an EVAL scope, savestack=15
    0 <> <a namespace >    |  7:        OPEN2
    0 <> <a namespace >    |  9:        EXACT <namespace>
                                   failed...
      restoring \1 to -1(0)..-1(no)
      restoring \1..\3 to undef
                                 failed, try continuation...
    0 <> <a namespace >    | 37:        NOTHING
    0 <> <a namespace >    | 38:        CLOSE1
    0 <> <a namespace >    | 40:        END
Match successful!
$
Freeing REx: `"\\s*((namespace\\s+\\w(\\w|\\d)*\\s*\\{\\s*)*)"'


You see where it says "Match successful!", that means that the 
expression (namespace\s+\w(\w|\d)*\s*\{\s*)* matched zero times.

Also, the expression \w(\w|\d)* could be simplified to \w+.


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: Sat, 21 Jun 2008 21:21:54 -0700 (PDT)
From: Peng Yu <PengYu.UT@gmail.com>
Subject: Re: Difference of * and + in regular expression
Message-Id: <e84b07ae-d769-45be-9e61-77871746516d@x35g2000hsb.googlegroups.com>

On Jun 21, 9:39 pm, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
> Peng Yu wrote:
> > If I used the uncommented if-statement, I would get no match.
>
> Not true. $1 is defined, so the regex does match.
>
> > $string="a namespace a { namespace b { namespace c { ";
>
> > #if ($string =~ /\s*((namespace\s+\w(\w|\d)*\s*\{\s*)+)/) {
> > if ($string =~ /\s*((namespace\s+\w(\w|\d)*\s*\{\s*)*)/) {
> >   print "$1\$\n";
> > }
>
> With the * quantifier, the regex seems to behave non-greedy, though.

According to the manual,  *? is non-greedy.
Why * is also non-greedy?

Thanks,
Peng


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

Date: Sun, 22 Jun 2008 06:46:49 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Difference of * and + in regular expression
Message-Id: <6c63puF3e0neiU1@mid.individual.net>

Peng Yu wrote:
> On Jun 21, 9:39 pm, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
>> Peng Yu wrote:
>>> If I used the uncommented if-statement, I would get no match.
>> Not true. $1 is defined, so the regex does match.
>>
>>> $string="a namespace a { namespace b { namespace c { ";
>>> #if ($string =~ /\s*((namespace\s+\w(\w|\d)*\s*\{\s*)+)/) {
>>> if ($string =~ /\s*((namespace\s+\w(\w|\d)*\s*\{\s*)*)/) {
>>>   print "$1\$\n";
>>> }
>> With the * quantifier, the regex seems to behave non-greedy, though.
> 
> According to the manual,  *? is non-greedy.
> Why * is also non-greedy?

I don't know, sorry. Maybe the answer can be derived from John's more 
extensive explanation.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Sat, 21 Jun 2008 21:17:43 +0200
From: "Pero" <pero@tupwerwt.ch>
Subject: How to make list of all htm file...
Message-Id: <g3jk4m$1he$1@localhost.localdomain>

I want to write search script in perl.
How to make list of all htm file on Linux - Apache web server?

Tnx.




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

Date: Sat, 21 Jun 2008 12:31:02 -0700
From: David Filmer <usenet@davidfilmer.com>
Subject: Re: How to make list of all htm file...
Message-Id: <2o-dnYchArZMy8DV4p2dnAA@giganews.com>

Pero wrote:
> I want to write search script in perl.
> How to make list of all htm file on Linux - Apache web server?

Perl is a big hammer for such a small nail.

How about just typing this at your commandline:

find . -name "*.htm"

(that recurses down from your current directory.  cd to \ if you want to 
find ALL such files anywhere they may exist.  But you probably want to 
start at your Apache DocumentRoot).


-- 
David Filmer (http://DavidFilmer.com)
The best way to get a good answer is to ask a good question.


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

Date: Sat, 21 Jun 2008 21:31:10 +0200
From: Bjoern Hoehrmann <bjoern@hoehrmann.de>
Subject: Re: How to make list of all htm file...
Message-Id: <melq54tdf2mse6kr4ua9qk4h9p32q57js0@hive.bjoern.hoehrmann.de>

* Pero wrote in comp.lang.perl.misc:
>I want to write search script in perl.
>How to make list of all htm file on Linux - Apache web server?

There may not be any files on a web server (all pages could be generated
by the web server software directly in memory) or an infinite number of
files (dynamically created based on user input). Further, if you do not
have direct access to the server but rather want to create this list for
a remote server, you are limited by the options of the protocol the web
server system supports (usually only HTTP for the general public). You'd
have to write a crawler, or use an existing one, that visits a page and
follows all the links on it, recursively, until "all" pages have been
visited. This is a rather limited approach as some pages might only be
accessible via links from third party web pages, so you would have to
index "the whole web" for a usable list.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 


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

Date: Sat, 21 Jun 2008 22:03:12 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: How to make list of all htm file...
Message-Id: <6c5544F39mqg7U1@mid.individual.net>

Pero wrote:
> I want to write search script in perl.
> How to make list of all htm file on Linux - Apache web server?

     locate -r \.html$ > htmlfiles.txt

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Sat, 21 Jun 2008 20:20:22 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: How to make list of all htm file...
Message-Id: <19oq549gq0uv2bp68crpb8d4o9k2c2kro5@4ax.com>

"Pero" <pero@tupwerwt.ch> wrote:
>I want to write search script in perl.
>How to make list of all htm file on Linux - Apache web server?

I'd use File::Find to loop through all files. Then for each file found
you could use one of the tools from http://validator.w3.org to check if
the file contains valid HTML code. You can also download the validator
code and install it locally to avoid calling their service a gazillion
times.

jue


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

Date: Sat, 21 Jun 2008 13:40:40 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: How to make list of all htm file...
Message-Id: <g3jp0802frk@news4.newsguy.com>

David Filmer wrote:
> Pero wrote:
>> I want to write search script in perl.
>> How to make list of all htm file on Linux - Apache web server?
>
> Perl is a big hammer for such a small nail.
>
> How about just typing this at your commandline:
>
> find . -name "*.htm"
>
> (that recurses down from your current directory.  cd to \ if you want
> to find ALL such files anywhere they may exist.  But you probably
> want to start at your Apache DocumentRoot).

Or, to find .htm or .html:

   $ find . | grep -P 'html?$'

Or also .shtml and .pshtml:

   $ find . | grep -P '[sp]?html?$'

Or to also find .xml

   $ find . | grep -P '([sp]?html?|xml)$'


You get the idea. Also, grep with the -P arg uses a Perl style regex :-)

-- 
szr 




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

Date: 21 Jun 2008 23:40:17 GMT
From: Swen Karlsson <karlsson@pooling.org>
Subject: ministeri paula  yle-peili:ssä öylön
Message-Id: <7NS4k.17948$_03.14669@11.35.67.75>

Fingridistä ydinupottaja.

07.06.2008 oli näemmä turhaa etsiä edes lehdistä päivää aiemmin julkaistua
ilouutista energiamarkkinoiltamme. Jotain todella outoa
tiedotussensuuripakoa Suomen ydinhallinnoltamme taas. Ja koska muut
tiedoitusvälineet jälleen näistä uskalla rivin riviä julkaista nin toki
kaikki jää taas ydintutusti niille jotka osaa ja uskaltaa, silvuplee arvon
lukijani.

Jos katsomme sähkölaskujamme huomaamme miten itse sähkön hinta on tuskin
samaa luokkaa kuin massiivinen yhtä suuri osuus sähkön siirtokustannusten
kanssa. Kun EU määräsi Fingrigin sähkönsiirtobisneksestä poistettavaksi
Fortumin, TVO:n ja tämänkaltaiset pelkästään niinikää energiantuotantoyhtiöt
oli se enemmän kuin shokki ydinalamme rahoituksille. Mikään nimittäin tässä
sähköbisneksessä ei ole niin tuottavaa kuin siirtoverkkofirmamojen loputon
ja takuuvarmistettu rahantulo siirtomaksuineen ilman kilpailupeikkoja.
Ydinyhtiöt mm. Fortum ovat omistamalla sähköverkkomonopoleja kyenneet
käyttämään ilmaiseksi omaa sähköverkko-osuuttaan laistaakseen kilpailevia
energiafirmoista täysin poiketen huikeita ydinsiirtosähkömonopolilaskuja.
Vielä kuppaamaan muilta sähköyhtiöiltä rahat pois!

Kyseessä on EU.n tulkinnan mukaan härskein mahdollinen
markkinavääristysmekaniikka myös ydinyhtiömonopoleillemme. Ja siksi niiden
markkinamääräävyydestä lyödään kerralla päätä poikki, tässä ja nyt! Eli
jatkossa se míkä lihottaa ydinyhtiöitämme Fortumeja ja muita muutetaan
plusalkumerkistä miinusmerkkiseksi valtaisaksi menon loiseräksi. Kuvaavaa
tilanteelle on se, että uutista ja sen taustoja ei maassamme lehtiyhtiöt
uskalla lainkaan julkaista, ei juuri edes muut. Mutta Fortumi mainittiin ja
mm. TVO jos mikä on nimenomaan EU:n mainitsema PELKKÄ energiantuotantoyhtiö
jos mikä! Joten maamme ydinyhtiöt saa niin  rankasti jopa EU:lta lunta
tupaan, että kenties kovasti enteellisesti TVO:n johtajaportaasta alkoi
asian julkitulosta ankarankova rotaatiopakohyllytystä jo perjantaista 06.06.
Elämme todella mielenkiintoisia aikoja ja näyttää ydinvaltiomonopoleilla
olevan enemmän kuin hikistä jatkotaivalta ankarasti tiedossa. Ehkä tosiaan
alkaa päivä paistamaan ja asiallisuus lyömään väkisin ydinmonopolejamme
härskeine ydinaikeineen ahtaalle!)


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

Date: Sun, 22 Jun 2008 04:42:19 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sun Jun 22 2008
Message-Id: <K2uL2J.15q0@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.

API-PleskExpand-1.04
http://search.cpan.org/~nrg/API-PleskExpand-1.04/
OOP interface to the Plesk Expand XML API (http://www.parallels.com/en/products/plesk/expand/). 
----
Acme-Maybe-0.01
http://search.cpan.org/~maxa/Acme-Maybe-0.01/
Take away the pain of decision-making! 
----
Class-XSAccessor-0.05
http://search.cpan.org/~smueller/Class-XSAccessor-0.05/
Generate fast XS accessors without runtime compilation 
----
DSlib-2.12
http://search.cpan.org/~madz/DSlib-2.12/
----
DateTime-Incomplete-0.0301
http://search.cpan.org/~fglock/DateTime-Incomplete-0.0301/
An incomplete datetime, like January 5 
----
Devel-Dt-0.02
http://search.cpan.org/~jjore/Devel-Dt-0.02/
Kind of emulates command line flag -Dt on normal perl 
----
Devel-Events-Objects-0.05
http://search.cpan.org/~nuffin/Devel-Events-Objects-0.05/
Object tracking support for Devel::Events 
----
Devel-Hints-Lexical-0.09
http://search.cpan.org/~chocolate/Devel-Hints-Lexical-0.09/
make %^H lexically-scoped 
----
Devel-StackBlech-0.01
http://search.cpan.org/~whitepage/Devel-StackBlech-0.01/
Dumps your stack, all of it, somewhere 
----
Devel-StackBlech-0.02
http://search.cpan.org/~whitepage/Devel-StackBlech-0.02/
Dumps your stack, all of it, somewhere 
----
Devel-StackBlech-0.03
http://search.cpan.org/~jjore/Devel-StackBlech-0.03/
Dumps your stack, all of it, somewhere 
----
Event-RPC-1.00
http://search.cpan.org/~jred/Event-RPC-1.00/
Event based transparent Client/Server RPC framework 
----
Finance-PremiumBonds-0.03
http://search.cpan.org/~bigpresh/Finance-PremiumBonds-0.03/
Perl extension to check Premium Bond holder's numbers 
----
Geo-Hashing-0.03
http://search.cpan.org/~zigdon/Geo-Hashing-0.03/
Perl library to calculate Geohashing points 
----
HTML-Menu-TreeView-1.01
http://search.cpan.org/~lze/HTML-Menu-TreeView-1.01/
----
HTML-Menu-TreeView-1.02
http://search.cpan.org/~lze/HTML-Menu-TreeView-1.02/
----
Jifty-Plugin-Authentication-Bitcard-0.051
http://search.cpan.org/~jhelwig/Jifty-Plugin-Authentication-Bitcard-0.051/
Bitcard authentication plugin 
----
Jifty-Plugin-Authentication-Bitcard-0.052
http://search.cpan.org/~jhelwig/Jifty-Plugin-Authentication-Bitcard-0.052/
Bitcard authentication plugin 
----
Jifty-Plugin-Authentication-Bitcard-0.052a
http://search.cpan.org/~jhelwig/Jifty-Plugin-Authentication-Bitcard-0.052a/
Bitcard authentication plugin 
----
Lingua-EN-Titlecase-0.07
http://search.cpan.org/~ashley/Lingua-EN-Titlecase-0.07/
Titlecasing of English words by traditional editorial rules. 
----
Mail-SpamCannibal-0.95
http://search.cpan.org/~miker/Mail-SpamCannibal-0.95/
A tool to stop SPAM 
----
MetaStore-0.28
http://search.cpan.org/~zag/MetaStore-0.28/
Set of classes for multiuser web applications. 
----
MooseX-NaturalKey-0.02
http://search.cpan.org/~samv/MooseX-NaturalKey-0.02/
make your constructor a candidate key match 
----
MooseX-Storage-0.14
http://search.cpan.org/~nuffin/MooseX-Storage-0.14/
An serialization framework for Moose classes 
----
MooseX-Types-URI-0.01
http://search.cpan.org/~nuffin/MooseX-Types-URI-0.01/
URI related types and coercions for Moose 
----
Muldis-D-0.35.0
http://search.cpan.org/~duncand/Muldis-D-0.35.0/
Formal spec of Muldis D relational DBMS lang 
----
Net-BGP-0.10
http://search.cpan.org/~kbrint/Net-BGP-0.10/
Border Gateway Protocol version 4 speaker/listener library 
----
Perlipse-0.02
http://search.cpan.org/~jae/Perlipse-0.02/
----
Proc-Exists-0.14
http://search.cpan.org/~brianski/Proc-Exists-0.14/
quickly check for process existence 
----
Proc-Exists-0.15
http://search.cpan.org/~brianski/Proc-Exists-0.15/
quickly check for process existence 
----
Sys-Info-0.52_6
http://search.cpan.org/~burak/Sys-Info-0.52_6/
Fetch information from the host system 
----
Test-TempDir-0.01
http://search.cpan.org/~nuffin/Test-TempDir-0.01/
Temporary files support for testing. 
----
Test-TempDir-0.02
http://search.cpan.org/~nuffin/Test-TempDir-0.02/
Temporary files support for testing. 
----
WWW-Curl-4.03
http://search.cpan.org/~szbalint/WWW-Curl-4.03/
Perl extension interface for libcurl 
----
WWW-Curl-4.04
http://search.cpan.org/~szbalint/WWW-Curl-4.04/
Perl extension interface for libcurl 
----
Win32-FileSystem-Watcher-0.1.0
http://search.cpan.org/~ank/Win32-FileSystem-Watcher-0.1.0/
Watch a Win32 file system for changes (asynchronously). 
----
XML-Atom-SimpleFeed-0.81
http://search.cpan.org/~aristotle/XML-Atom-SimpleFeed-0.81/
No-fuss generation of Atom syndication feeds 
----
XML-Atom-SimpleFeed-0.82
http://search.cpan.org/~aristotle/XML-Atom-SimpleFeed-0.82/
No-fuss generation of Atom syndication feeds 
----
XML-LibXSLT-Easy-0.01
http://search.cpan.org/~nuffin/XML-LibXSLT-Easy-0.01/
----
accessors-1.01
http://search.cpan.org/~spurkis/accessors-1.01/
create accessor methods in caller's package. 
----
mysubs-0.01
http://search.cpan.org/~chocolate/mysubs-0.01/
lexical subroutines 
----
tidyview-1.14
http://search.cpan.org/~leif/tidyview-1.14/
a previewer for the effects of perltidy's plethora of options 


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/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion


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

Date: Sat, 21 Jun 2008 20:25:41 +0200
From: Dave B <daveb@addr.invalid>
Subject: Re: Substituting in a group
Message-Id: <g3jh88$lkp$1@registered.motzarella.org>

Martijn Lievaart wrote:

>> $ perl -pe 'if (s/"([^"]*)"/$1/) {$m=$n=$1; $n=~s/,/#/g; s/$m/$n/;}'
>>[snip]
>
> Very good! Now change it slightly (untested):
> 
> perl -pe 'if (/"([^"]*)"/) {$n=$1; s/"([^"]*)"/$n/ if ($n=~s/,/#/g); }'
> 
> The first substitution is guaranteed to match the same string as the 
> match, so the assumption is not relevant anymore.

This avoids the use of an extra variable, but on the other hand does not
remove the double quotes if there are no commas in the matched string (which
should not happen anyway, according to the OP).
Thanks!

-- 
D.


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

Date: Sat, 21 Jun 2008 20:30:38 +0200
From: Dave B <daveb@addr.invalid>
Subject: Re: Substituting in a group
Message-Id: <g3jhhh$lkp$2@registered.motzarella.org>

Dave B wrote:
> Martijn Lievaart wrote:
> 
>>> $ perl -pe 'if (s/"([^"]*)"/$1/) {$m=$n=$1; $n=~s/,/#/g; s/$m/$n/;}'
>>> [snip]
>> Very good! Now change it slightly (untested):
>>
>> perl -pe 'if (/"([^"]*)"/) {$n=$1; s/"([^"]*)"/$n/ if ($n=~s/,/#/g); }'
>>
>> The first substitution is guaranteed to match the same string as the 
>> match, so the assumption is not relevant anymore.
> 
> This avoids the use of an extra variable, but on the other hand does not
> remove the double quotes if there are no commas in the matched string (which
> should not happen anyway, according to the OP).

Maybe this is the safest:

perl -pe 'if (/"([^"]*)"/) {$n=$1; $n=~s/,/#/g; s/"([^"]*)"/$n/;}'

-- 
D.


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

Date: Sat, 21 Jun 2008 22:52:02 -0500
From: Niklas Järvinen <niklas@naki.org>
Subject: Re: Tosi epäselvä raitiovaunukolarin syy.
Message-Id: <ppB3k.15698$_03.12333@200.80.88.224>

Kuinka syvältä uraanit?

Aikoinaan I. Karaila netissä laski uraanin kaivuun olevan 0,1% jo
irrotusenergiansa osalta täysin kannattamattoman. Myös STUK ja GTK ilmoittaa
0,1% uraanin olevan teoreettisessa kannattavuusrajassaan jo normaalissa
parhaimmanluokan teollisussirroituksessa. Ja kun huomioimme
avoaumasliuoituksen romahtamisen 15% todellisen saannin energian hukka
vähintään 5 kertaa alle saannon. Kun TVO ilmoitti  2007 jälkeen maailman
uraanimalmien keskimääräisen pitoisuuden putoavan 0,4% myös tämän malmin
saanti romahtaa aiemman korkeamman hyödyn rikkaan malmion saannista
viidesosaan. Näin todellinen saanti putoaa suuren määrän karkeassa
avoaumausliotuksesta 0,06%. Karkeasti 1 kWh sisälle irrotusräjähteisiin,
lajittelijoihin, murskaimiin ja ulos uraanista saataisiin vain 0,6kWh.
Systeemillä ei ole energiapositiivista yhtälöä enää. Kiinnostuin perustasta
kuinka syvältä kiveä ylipäätään energiapositiivisesti edes nostaa. Kuulostaa
aika absurdilta, mutta jopa öljyä ei kannata porata kilometrien syvyyksistä,
koska siitä saatava energia ei enää kata edes nostokuluja!

Lähtöarvoksi otan vesienergiasta saatavia peruskaavoja. 0,1%/15%
uraaninmalmin saannilla laskin maastamme noin neliödesimetrin edustavan yhtä
saatua kWh:ta. Aloitetaanpa tapaus Ronneburgista, jossa kaivettiin jopa alle
0,1% uraania jopa 2km syvyydestä. Kun seinämä räjäytetään lasken kaiken
rojahtavan yksinkertaisuuden vuoksi pohjaan. Uraanimalmin paino 3 000kg/m3.
Kuljetuskalusteeksi auton summittain 10% hyötysuhteella. Huomioin tässä
auton 25% perusenergiatalouden moottorissa. Vaihteen häviöt. Sen faktan,
että noutoauto tekee edestakaisessa matkassaan takaisin pohjalle vain 50%
energiamielessä nostotyötä jne. 20m*0,01m2 pala= 0,2m3 malmikiveä josta
tulee 1kWh. 2km matkalla muodostuu 0,2*100= 20m3 edustaen 100kWh. Painoltaan
tämä vastaa silloin 3t/m3* 20m3= 60m3 vettä. Luku pitää kertoa kuorma-auton
huonolla 10-kertaistuvalla hyötysuhteella. 10*60m3= 600m3. Tästä osaan jo
laskea veden energiantuoton tunnin aikana sen pudotessa 2km, kun huomioin
tuntiin sisältyvän sekuntimäärän . 600m3/3 600s/h= 0,17m3/s.

Nyt saamme jo suoraan kWh työn veden kaavasta: 0,17m3/s*2 000m*9,81= 3
270kWh on tarvittu nostoenergia, jotta saavutetaan suunnilleen 0,1%
uraanista saatava 100kWh perustuotto. 3 270kWh/100kWh= 32,7-kertaa vähemmän
kuin mitä pelkästään jo nostoon kului energiaa! Siis aivan tolkutonta
uraanienergian kaivunmetodia näytti taannoinen CCCP jo 60-luvulla suosivan
DDR:ssä. Vielä voimme modifioida teoreettisen noston "nollarajan". 2
000m/32,7=  61m olisi näillä metodein se uraanikaivoksen perussyvyys josta
moista Uudenmaan 0.1% perusuraania ei siis edes kannattaisi tosiaan nostaa
kuorma-autolla! Ja huomatkaa nyt puhun pelkästään "nostosta". En
irtiräjäytyksistä, murskauksista, hapotusenergioista jopa monttuun
jatkuvasti tunkeva pohja- ja sadevesi on systeemissä kallista jatkuvasti
pois nostettavaa lisäkulutusta aina. Laskelma on mitä mieltä kääntävintä jo
syystä, että esim. Limoussinen taannoinen uraanikaivos oli 400m syvä.
Limoussinesta tulisi energiamielessä pelkästä perusnostosta tuplat
triplatappiot jo. Tähän laskin, jotta hahmotettaisiin niitä perustavia syitä
miksei Suomeen suunniteltavat uraanikaivokset ole kovin syviä.
Todellisuudessa jo esittämästäni hahmottuu aika hyvin miksei puhuta kuin 20m
peruskaivunsyvyyksistä Arevan uraanihankkeissa.


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

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 V11 Issue 1666
***************************************


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