ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl6-language
perl6-language
PGE error?
by B=C1RTH=C1ZI_Andr=E1s other posts by this author
Jun 10 2005 1:29AM messages near this date
Re: q:e/.../ as a short cut for eval q/.../ | Re: PGE error?
Hi,

I don't know what happens and where in the code, but... Anyway, it's 
strange... I have this code and input.tpl:

--------------- 8< -------------------

rule sp {
     <[ ]> 
}

rule id {
     <[a..z]> <[a..z0..9]>+
}

sub do($match) {
     say $match[0];
     return "+";
}

my $template=slurp('input.tpl');

$template ~~
     s:g!
     [ \< server \: (<id> ) [<sp>+ $?id:=(<id>) <sp>*=<sp>*"(<-["]>*)"]* 
<sp> * \> (.*?) \<\/ server \: $0 \> ]
     |
     [ \< server \: (<id> ) [<sp>+(<id>)<sp>*=<sp>*"(<-["]>*)"]* <sp>* \/\> ]
     !{ do($/) }!;

say $template;

--------------- 8< -------------------

text

<server:foo /> 

<server:huh /> 

text

<server:boo>  inside <server:huh /> inside </server:boo>

text

--------------- 8< -------------------

Running it several times, one time works: matches and replaces </>  
things to +-es, one time it not works... Randomly. Where should I send 
these kind of bugs?

Bye,
   Andras
Thread:
B=C1RTH=C1ZI_Andr=E1s
Juerd

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved