CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
substitution prob


New User

Dec 22, 2005, 2:31 PM

Post #1 of 2 (454 views)
substitution prob Can't Post

hi, ive got stumped by a substitution that just refuses to work.

the following is part of a datafile which is part html part "ecsl" a simple scripting language im working on.

some html guff>

open dataset (userpages);


<a!!username!!password=!!password!!&pagename=%pagename%&action=edit>%pagetitle% </a><br>

until endofset;


<more html guff

my code can sucessfully extract the ecsl code and parse it, but im having trouble putting the result back in the place originally occupied by the code for output to the browser.

my substitute command reads :

$codestring = "\x3C\x3F $ECSLCODECHUNKS{$key} \x3F\x3E";

$output = "the result of the ecsl interpret";

$page =~ s/$codestring/$output/gxim;


the ECSLCODECHUNKS hash key when printed out looks identical to the original code but the substitute just cant seem to find it.

HELP Unsure


Dec 23, 2005, 2:30 AM

Post #2 of 2 (450 views)
Re: [simonodell] substitution prob [In reply to] Can't Post

What is contained in $ECSLCODECHUNKS{$key}

You have spaces either side of \x3C\x3F and \x3F\x3E but there aren't spaces in the code - also your regex will need the /s modifier.

(This post was edited by MrPJ on Dec 23, 2005, 2:31 AM)


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives