Gerald Richter wrote:
> 
> > > >
> > > > <!--#include embperl="/list-stuff.epl">
> > > >
> > >
> > > Should this be a replacement for [- Execute ('/list-stuff.epl') -] ?
> >
> > Yes, Precisly.
> >
> > > If yes, it should be esay to add to Embperl/Syntax/SSI.pm
> >
> > Sweet.
> >
> 
> Patches are welcome :-)

Ok, I've got a better patch now. I've removed my earlier debug code and
the <!--#include embperl="foo"--> hack. I've changed the code for
<!--#include file="file"--> So that it does this instead:

Execute ({inputfile=>$file, output=>$return, syntax=> "Text"})

May as well use the technology if it exists, instead of opening and
reading the file manually...

<!--#include virtual="file"-->

Basically does this now:

Execute ({inputfile=>$virtual_file, output=>$return, syntax=>"SSI"})

If somebody wants to put Embperl code into $virtual_file, right now
they'd have to switch the syntax using <!--#syntax type="Embperl
SSI"-->. I'm not to sure how this could be made smarter, or inherit the
default of the calling document.

The only other thing I need to play yet with, is to get this to work:

<!--#include virtual="/something?foo=bar&baz=tan"-->

I guess basically split on the ?, then throw the arguments into %fdat...
 
> > Is optDisableTableScan gone forever?  Or is it one of those things
> > that's hard to reimplement in the 2.0 rewrite?
> 
> Maybe it will come again, not sure. I prefer more to make Embperl more smart
> to handle such situations automaticly correct...

Of course... by the way, regarding the </td>/tr/table thing I discovered
the other day... I discovered something which may or not help, but I'll
mention it anyway since it might help. I was taking a look at
HTML::Embperl::Syntax::EmbperlHTML::Init, and noticed that it wasn't
doing a AddTagBlock for td... so I commented out the AddTagBlocks for tr
and table, and now <td></tr></table> comes through fine...

> For now you can use the syntax command to get the same result:
> 
> [$syntax EmbperlBlocks $]

Ok.


-- 

Regards,

Wim Kerkhoff, Software Engineer
Merilus, Inc.  -|- http://www.merilus.com
Email: [EMAIL PROTECTED]
225,227c225,234
<         return $fn if ($fn) ;
<         die "Cannot use 'virtual' without mod_perl" if ($virt) ;
<         return $ENV{DOCUMENT_NAME} ;
---
>         return $fn if ($fn);
> 
>       my $filename = $virt;
>         
>       #die "Cannot use 'virtual' without mod_perl" if ($virt) ;
> 
>       if ($filename =~ /^\//) {
>               $filename = $ENV{DOCUMENT_ROOT} . $filename;
>       }
>       return $filename;
237c244
<         my $req = $apreq -> lookup_uri (InterpretVars ($fn)) ;
---
>         my $req = $apreq -> lookup_uri (InterpretVars ($virt)) ;
242c249
<         return $ENV{DOCUMENT_NAME} ;
---
>         return $ENV{DOCUMENT_NAME} || $ENV{SCRIPT_FILENAME};
327,337c334,354
< sub include 
<     {
<     my($fn, $virt) = @_;
<     
<     my $file = find_file($fn, $virt) ;
<     local $/ = undef ;
<     local $HTML::Embperl::escmode = 0 ;
< 
<     open FH, "<$file" or die "Cannot open $file ($!)" ;
<     my $val = <FH> ;
<     close FH ;
---
> sub include {
>       my($fn, $virt) = @_;
>                               
>       local $/ = undef ;
> 
>       my $type = "SSI"; # adding Embperl to syntax results in errors I can't figure 
>out...
>       my $filename = $virt;
> 
>       if ($fn) {
>               $type = "Text";
>               $filename = $fn;
>       }
>       elsif ($virt) {
>               if ($filename =~ /^\//) {
>                       $filename = $ENV{DOCUMENT_ROOT} . "/$filename";
>               }
>       }
>       else {
>               warn "Nothing to #include... need file or virtual";
>               return "";
>       }
339,340c356,357
<     return $val ;
<     }
---
>       my $output = "";
>       HTML::Embperl::Execute({inputfile=>$filename, output=>\$output, 
>syntax=>$type});
341a359,360
>       return $output;
> }
354d372
< 
361d378
< 
364d380
< 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to