[27885] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9249 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 31 14:05:50 2006

Date: Wed, 31 May 2006 11:05:03 -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, 31 May 2006     Volume: 10 Number: 9249

Today's topics:
        Announce: WebDyne (Yet Another Web Framework) <andrew.speer@isolutions.com.au>
    Re: basic regex back reference <rvtol+news@isolution.nl>
    Re: Date format conversion <David.Squire@no.spam.from.here.au>
    Re: How do I run a Perl script as a Windows XP Service? <zentara@highstream.net>
    Re: How to have a Perl script emulate a keystroke to an nmaier@unimax.com
    Re: Negated Perl Regexp <ro.naldfi.scher@gmail.com>
    Re: Negated Perl Regexp <ro.naldfi.scher@gmail.com>
        new CPAN modules on Wed May 31 2006 (Randal Schwartz)
        safe-module and namespaces <pilsl@goldfisch.at>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 31 May 2006 07:11:53 GMT
From: Andrew Speer <andrew.speer@isolutions.com.au>
Subject: Announce: WebDyne (Yet Another Web Framework)
Message-Id: <J04qG2.1JE8@zorch.sf-bay.org>

comp.lang.perl.misc
"Perl promotes laziness, impatience and hubris."
-Pickup up Perl, http://ebb.org/PickingUpPerl/

I have used Perl in the past to develop various web based applications.

I disliked how long it took to get a simple page working (impatience). I
wished someone would come up with a better way of generating HTML with Perl 
(laziness) .. and finally decided I would try and write my own (hubris).

That was a while ago. You can see the result at http://webdyne.org/

WebDyne is another variation on the theme of combining HTML and Perl. I hope 
it will make it easier to produce reasonably powerful and complex 
applications without the usual problem of mixing up content and code 
(although like all good Perl programs it will let you do that if that is
what you want).

If you dabble with Perl and HTML, or used to use Perl previously for web
apps but have now switched to PHP, please take a look and let me know what
you think.

There are plenty of examples in the documentation to give you an idea of how 
it works, and you are welcome to ask questions directly or via the mailing 
list.

I am aware of HTML::Mason and Embperl. I have dabbled with those frameworks,
but decided to go off in my own direction. WebDyne is "another way to do
it", not "the only way to do it" !

This is the first public release, so be patient with it ..

Download is available from CPAN:

http://search.cpan.org/~aspeer/

Or via the home page

http://webdyne.org/

Andrew Speer
andrew.speer@webdyne.org




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

Date: Wed, 31 May 2006 13:10:17 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: basic regex back reference
Message-Id: <e5k4pb.1a8.1@news.isolution.nl>

gcr schreef:

> /(\[+[*\d]+\])/

The "\[+" means: one or more literal "["s.

The "[*\d]" is a character class off a literal asterisk and a digit, so
it tries to match either an asterisk or a digit. The "+" behoind it
means "one or more of the previous" again.

ITYM: /(\[\d+\])/
which means: a literal "[", followed by one or more digits, followed by
a literal "]".

-- 
Affijn, Ruud

"Gewoon is een tijger."




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

Date: Wed, 31 May 2006 11:45:05 +0100
From: David Squire <David.Squire@no.spam.from.here.au>
Subject: Re: Date format conversion
Message-Id: <e5js3h$m0h$1@news.ox.ac.uk>

Robert wrote:
> Thank you for your answer!
> 
> Robert
> 

Thank who for what answer? Please quote context and include 
attribution(s) when you reply.

DS


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

Date: Wed, 31 May 2006 12:12:45 GMT
From: zentara <zentara@highstream.net>
Subject: Re: How do I run a Perl script as a Windows XP Service?
Message-Id: <ga1r72tn29gt3oa4p95j1h6ticlbcoc9l0@4ax.com>

On 31 May 2006 01:12:53 -0700, "janicehwang1325@yahoo.com"
<janicehwang1325@yahoo.com> wrote:

>Hi all,
>
>
>I would like to run my Perl script as the service in Windows XP. How do
>achieve that? I heard that using Microsoft Management Console can
>achieve that. However, read thru the help file of the MMC, i still do
>not get how to create it. Do someone know how to start from the very
>beginning step?

Personally I don't use Win32, but check out these:

http://perlmonks.org?node_id=522586
 
http://perlmonks.org?node_id=251168

http://perlmonks.org?node_id=338496

or do yourself a favor, and ask there.



-- 
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html


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

Date: 31 May 2006 05:25:13 -0700
From: nmaier@unimax.com
Subject: Re: How to have a Perl script emulate a keystroke to another application
Message-Id: <1149078312.981868.278090@y43g2000cwc.googlegroups.com>

Thank you!! I'll give that a try.



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

Date: 31 May 2006 03:37:51 -0700
From: "Ronny" <ro.naldfi.scher@gmail.com>
Subject: Re: Negated Perl Regexp
Message-Id: <1149071871.806588.188730@c74g2000cwc.googlegroups.com>


Ted Zlatanov schrieb:

> On 30 May 2006, ro.naldfi.scher@gmail.com wrote:
>
> > Background of what this is needed for: I'm writing tiny utilities in
> > Perl, which act as a filter for input text. Typically, the core of
> > the "program" contains something like
> >
> > /$PATTERN/ && print(transform($_))
> >
> > i.e. read all lines from stdin, and if they match some pattern,
> > print out a transformed version of the line. The is supplied via
> > ARGV. This works fine, but I also would like the user of this
> > utility to be able to *revert* the sense (i.e. read all lines from
> > stdin, and if they DO NOT match the pattern, etc.), like you have
> > with grep (where the option -v reverts the test).
>
> > The keypoint here is that in this particular application, I would
> > prefer NOT to introduce an option such as grep's "-v" to my utility,
> > but encode the "negation of the pattern" into the pattern itself.
>
> You either ask the user to rewrite $PATTERN, or you give a -v option.
> I don't understand how you would know *when* to negate the pattern
> without a -v option.

You exactly got the point: I want the user to rewrite the Pattern. The
question
is, how to write a *negated* pattern using Perl RE Syntax?

To the outside world (i.e. to the user), the interface always says kind
of
"Supply a pattern and you get a list of lines matching the pattern"
(actually,
the lines returned are transformed, but this is not the point here).
Given
*this* user interface, is it possible for the user to specify a pattern
with
negated meaning - for example, return all lines which do NOT contain
the string "foo"?

A variation of this question could be: Return all the lines which do
contain
the string "foo" and "bar", but ONLY if they do not contain "baz"
somewhere
between "foo" and "bar". I.e. the lines

   ...foo.......bar......baz...   (OK, baz after bar)
   ...baz......foo......bar....   (OK, baz before bar)
   ...foo..................bar...   (OK, no baz)

should match, but the lines

   ...foo........baz......bar...   (baz between foo and bar)
   ...foo...........................   (bar missing)
   ...bar...........................   (foo missing)

should not match. Is it possible to express THIS using perl regexp,
or do I break here the power of Perl regular expressions? If there
is a solution to this foo/bar/baz problem, then there is obviously
one for my original problem as well.

> > Is this possible at all within the realm of Perl regular
> > expressions, or do I have to invent my own workaround (which of
> > course would be possible)?
>
> Yes usually (for example, it may not work nicely if you have code
> embedded inside the regex, and there are many cases that are possible
> but computationally very expensive), but it's much more complicated to
> invert a regex than to invert the test for that regex.

Of course, one hack for my original problem would be to "invent" a
special
character (say, exclamation mark) which is allowed to be at the very
start
of the expession, and just has the meaning "pattern has negated
meaning".
My Perl code would then be:

  if($pattern =~ /^!(.*)$/)
  {
    # negated meaning
    $pattern=$1; # drop ! from pattern
    print transform($line) unless($line =~ $pattern)
  }
  else
  {
    print transform($line) if ($line =~ $pattern)
  }

This would do the job (and the exclamation mark here is just a "-v"
switch
in disguise), but I wondered whether the same effect could also be
achieved
by just changing the pattern in a suitable way.

> I honestly don't see a reason why you shouldn't provide a -v option,

The reason is because I simplified the problem very much so to make
it better feasible to discuss here. The interesting point for me is not
finding out whether the negation effect can be done solely within the
pattern, or has to be "moved outside" to the distinction between
=~ and !~, or if/unless construct.

I have read the man pages about pattern "negation" (such as it occurs
in the "negative lookahead pattern"), but I did not see whether they
could
be applied to my case.

Ronald



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

Date: 31 May 2006 03:49:51 -0700
From: "Ronny" <ro.naldfi.scher@gmail.com>
Subject: Re: Negated Perl Regexp
Message-Id: <1149072591.923125.215160@f6g2000cwb.googlegroups.com>


Mirco Wahab schrieb:

> Thus spoke Ronny (on 2006-05-30 09:51):
>
> > Typically, the core of  the "program" contains something like
> >
> > /$PATTERN/ && print(transform($_))
> > ...
> > This works fine, but I also would like the user of this utility
> > to be able to *revert* the sense (i.e. read all lines from stdin,
> > and if they DO NOT match the pattern, etc.),
>
> you mean
>
>   print(transform($_)) unless /$PATTERN/;
>
> or something?

No, the corresponding code would always be as stated. I think I did not
explain my problem in a very understandable way. See my reply to Ted
for a more elaborate explanation.

Maybe here a more mathematical formulation of the problem:

Given an arbitrary Perl regexp P, is it then possible to derive from it
another
regexp Q, with the property that for every string S the following
equation holds:

  (S =~ P) == (S !~ Q)

(S matches P if S does not match Q, and vice versa).

I.e. is there a general mechanism within the Perl regexp realm which
allows
me to find a negated pattern for a given pattern?

Of course this is easy for specific pattern. For example, assume that P
is
the pattern

   [abc]

which means "every line which either contains at least one a, b or c
somewhere".
The negated pattern Q, "every line which contains neither a, b or c" is
then

  ^[^abc]+$

In this example, I have kind of "handcrafted" the negated pattern after
having
investigated the original pattern. For the [abc] case, it was easy to
find the
negated pattern, but in general, this might be hard, so I wondered
whether
Perl provided a specific construct which just negates a pattern.

Ronald



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

Date: Wed, 31 May 2006 04:42:05 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Wed May 31 2006
Message-Id: <J04525.r29@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.

WebService-JugemKey-Auth-0.02
http://search.cpan.org/~mizzy/WebService-JugemKey-Auth-0.02/
Perl interface to the JugemKey Authentication API
----
PCL-Simple-1.02
http://search.cpan.org/~prl/PCL-Simple-1.02/
Create PCL for printing plain text files
----
Mail-Audit-2.200_02
http://search.cpan.org/~rjbs/Mail-Audit-2.200_02/
Library for creating easy mail filters
----
Net-Flickr-RDF-1.7
http://search.cpan.org/~ascope/Net-Flickr-RDF-1.7/
a.k.a RDF::Describes::Flickr
----
SMS-Send-DE-MeinBMW-0.01
http://search.cpan.org/~borisz/SMS-Send-DE-MeinBMW-0.01/
An SMS::Send driver for the www.meinbmw.de website
----
Math-Pari-2.010705
http://search.cpan.org/~ilyaz/Math-Pari-2.010705/
Perl interface to PARI.
----
Simpy-0.00_0.14
http://search.cpan.org/~beadsland/Simpy-0.00_0.14/
Perl interface to Simpy social bookmarking service
----
Simpy-0.00_0.13
http://search.cpan.org/~beadsland/Simpy-0.00_0.13/
Perl interface to Simpy social bookmarking service
----
Data-Tabular-0.25
http://search.cpan.org/~gam/Data-Tabular-0.25/
Handy Table Manipulation and rendering Object
----
CGI-PathParam-0.01
http://search.cpan.org/~yoshida/CGI-PathParam-0.01/
Add path_info parser to CGI.
----
Simpy-API-0.00_0.12
http://search.cpan.org/~beadsland/Simpy-API-0.00_0.12/
Perl interface to Simpy social bookmarking service
----
CGI-Ex-2.00
http://search.cpan.org/~rhandom/CGI-Ex-2.00/
CGI utility suite - makes powerful application writing fun and easy
----
Device-Serdisp-0.05
http://search.cpan.org/~fuzz/Device-Serdisp-0.05/
Perl extension for talking to the serdisplib
----
Astro-SpaceTrack-0.018
http://search.cpan.org/~wyant/Astro-SpaceTrack-0.018/
Retrieve orbital data from www.space-track.org.
----
WWW-PkgFind-1.3
http://search.cpan.org/~bryce/WWW-PkgFind-1.3/
Spiders given URL(s) mirroring wanted files and triggering post-processing (e.g. tests) against them.
----
chklinks-3.01
http://search.cpan.org/~imacat/chklinks-3.01/
A non-threaded Perl link checker
----
Catalyst-Model-DBI-SQL-Library-0.13
http://search.cpan.org/~alexp/Catalyst-Model-DBI-SQL-Library-0.13/
SQL::Library DBI Model Class
----
Catalyst-Model-DBI-0.12
http://search.cpan.org/~alexp/Catalyst-Model-DBI-0.12/
DBI Model Class
----
Carp-Indeed-0.05
http://search.cpan.org/~ferreira/Carp-Indeed-0.05/
Warns and dies noisily with stack backtraces
----
Tk-Schedule-0.01
http://search.cpan.org/~knorr/Tk-Schedule-0.01/
Perl extension for a graphical user interface to carrying out tasks up to schedule
----
Tk-TimePick-0.02
http://search.cpan.org/~knorr/Tk-TimePick-0.02/
Perl extension for a graphical user interface to pick timestrings syntax mistake-secure
----
WWW-phpBB-0.01
http://search.cpan.org/~stefant/WWW-phpBB-0.01/
phpBB forum scraper
----
Tie-DBI-1.02
http://search.cpan.org/~lds/Tie-DBI-1.02/
Tie hashes to DBI relational databases
----
Bundle-WebDyne-Dist-1.26
http://search.cpan.org/~aspeer/Bundle-WebDyne-Dist-1.26/
WebDyne Bundle
----
Audio-Ecasound-0.91
http://search.cpan.org/~bowmanbs/Audio-Ecasound-0.91/
Perl binding to the ecasound sampler, recorder, fx-processor
----
XML-Liberal-0.11
http://search.cpan.org/~miyagawa/XML-Liberal-0.11/
Super liberal XML parser that parses broken XML
----
XML-Liberal-0.10
http://search.cpan.org/~miyagawa/XML-Liberal-0.10/
Super liberal XML parser that parses broken XML
----
WWW-Yandex-CY-1.00
http://search.cpan.org/~kostya/WWW-Yandex-CY-1.00/
Yandex Thematic Index of Citing (TIC) for domain
----
Math-RandomOrg-0.03
http://search.cpan.org/~gwilliams/Math-RandomOrg-0.03/
Retrieve random numbers and data from random.org.
----
chklinks-3.00
http://search.cpan.org/~imacat/chklinks-3.00/
A non-threaded perl link checker
----
Geo-ReadGRIB-0.4
http://search.cpan.org/~frankcox/Geo-ReadGRIB-0.4/
Perl extension that gives read access to GRIB "GRIdded Binary" format Weather data files.
----
WWW-GameMonitor-0.02
http://search.cpan.org/~wilsond/WWW-GameMonitor-0.02/
Fetch information about game servers from Game-Monitor.com
----
Hey-Cache-0.01
http://search.cpan.org/~wilsond/Hey-Cache-0.01/
Cache data multiple data structures
----
Class-Meta-Express-0.02
http://search.cpan.org/~dwheeler/Class-Meta-Express-0.02/
Concise, expressive creation of Class::Meta classes


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.

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: Wed, 31 May 2006 14:05:17 +0200
From: peter pilsl <pilsl@goldfisch.at>
Subject: safe-module and namespaces
Message-Id: <447d867e$0$563$79720d31@newsreader.inode.at>


I try to use the safe-module to evaluate user-provided code, but it 
seems there is a knot in my brain.

use Safe;
$s=new Safe "xxx";
$xxx::x=3;
$s->reval('$x=4');
print $xxx::x,"\n"


Well, this prints out 3 as result and I think it should be 4!
What am I not thinking of?

thnx,
peter


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

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


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