You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by David Williams <da...@conceptionstore.com> on 2002/11/25 05:01:15 UTC

I admit....

I admit that my legacy embperl code really sucks. Unfortunately there's
thousands of lines of it and I have angry customers who are waiting for the
upgrade to be complete, so I am asking for something more than criticism of
old code... Is there a way for my old crappy code to work under Embperl2c
and Apache 2.0x?

At 8:12 PM -0500 11/24/02, David Williams wrote:
><a href=http://www.conceptionstore.com><img src=/images/cstore.gif
>border=0></a>
>
>becomes:
>
><a href="http" ://www.conceptionstore.com><img src /images/cstore.gif
>border=0></a>
>
>which is un-renderable.

However it is in fact a perfect representation of what you had.
According to the HTML spec, your href value ended at the colon after
http.  Even if Embperl didn't rewrite the URL, it wouldn't properly
escape any variables you put it in, because it's extremely invalid
HTML.  You really need to quote those URLs if you want them to work
properly.  Some browsers may be lenient about it, but I wouldn't want
to gamble on it for all of them.

One of the big benefits of Embperl is it's ability to parse your HTML
and take care of a lot of automatic things (filling in forms, looping
on table rows...).  But that does mean that you have to make sure
your HTML is correct so that it can parse it.
--

Kee Hinckley - Somewhere.Com, LLC
http://consulting.somewhere.com/

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: I admit....

Posted by Cameron McBride <ca...@cwru.edu>.
On Sun, Nov 24, 2002 at 11:01:15PM -0500, David Williams wrote:
> I admit that my legacy embperl code really sucks. Unfortunately there's
> thousands of lines of it and I have angry customers who are waiting for the
> upgrade to be complete, so I am asking for something more than criticism of
> old code... Is there a way for my old crappy code to work under Embperl2c
> and Apache 2.0x?

well, I must say - thats a gutsy thing to do.  Upgrade a production
server to yet unreleased CVS versions of processing code.  Nice.
Actually, I was thinking of doing the same - just haven't gotten there
yet.  ;-)

If you don't need the HTML munging, you might be able to avoid the
problem by turning it off.  In 2.0b (Embperl) you can choose syntax.

Snippit from the README.v2:
========
syntax / EMBPERL_SYNTAX / [$ syntax $]

Used to tell Embperl which syntax to use inside a page. Embperl comes with
the following syntaxes: 

    - EmbperlHTML       # all the HTML tags that Embperl recognizes by default
    - EmbperlBlocks     # all the [ ] blocks that Embperl supports
    - Embperl           # (default; contains EmbperlHtml and EmbperlBlocks)
========

So in the configuration file (httpd.conf or however), enter a
'EmbperlBlocks' for the EMBPERL_SYNTAX.   (it defaults to 'Embperl')

This might work as your first email suggests that dynamic content is
fine.  If you need HTML munging, perhaps a proper value for escmode
might do trick.

Hope it works out!

Cameron

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org