Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^14: Thanks to Ikegami, Chromatic & Corion

by ikegami (Pope)
on Nov 03, 2011 at 01:54 UTC ( #935544=note: print w/ replies, xml ) Need Help??


in reply to Re^13: Thanks to Ikegami, Chromatic & Corion
in thread Thanks to Ikegami, Chromatic & Corion

$maskCopy =~ s@<some_marker>@$item@gs;

But what if $item was HTML from a database instead of being hardcoded aXML...


Comment on Re^14: Thanks to Ikegami, Chromatic & Corion
Select or Download Code
Re^15: Thanks to Ikegami, Chromatic & Corion
by Logicus on Nov 03, 2011 at 02:17 UTC

    Well you wouldn't want to be putting the <ul> tags in then.

    Ok so...

    If our database looked like this

    pageid int primary key auto_increment, name varchar(255), html text Then (db_get)pages.name="(sqd)name(/sqd)".html(/db_get)

    Then localhost:5000?action=test&name=homepage will be displaying the contents of the html column of the pages db.

      Did your post get cut short? You were trying to prove to me that your plugin wasn't buggy.

      Or are you saying that the result of (plugin)(/plugin) isn't searched for tags? I thought it was the same as <plugin></plugin> except for precedence.

        Whenever the document is modified the main loop restarts at the top. A future optimisation could possibly move a cursor pos along so that bits which have been scanned don't get scanned again, but I haven't got that far into optimising it yet and I probably wont for some time because it seems fast enough as it is.

        Since the parser starts by looking for ( ) tags it makes sense to use them first, save scanning for them and finding nothing before scanning for < >

        What bug btw?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://935544]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (12)
As of 2014-07-30 16:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (235 votes), past polls