You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Geoffrey Lowney <Gl...@rei.com> on 2005/01/31 23:36:17 UTC

lost '#'s inside #literal()/#end

I am using VTL (with VPP) to customize a portion of a Perl script.
Since Perl code has a lot of dollar signs, I am using #literal()/#end to
prevent Velocity from processing most of the file.  What I find is that
single '#' characters that are not followed by alpha text are removed
(inside #literal()/#end).

For example:

  #literal()
  #!/usr/bin/perl
  #end

becomes:

  !/usr/bin/perl

I've tried things like escaping the '#' ('\#') but that leaves the
backslash ('\#!/usr/bin/perl' becomes '\!/usr/bin/perl').  Nothing seems
to work.

I can use a #set to define a variable with the value '#!/usr/bin/perl',
but I was hoping I would not have to.  It also doesn't help with other
single #'s in the file (like Perl comments).  For those I have had to
double up the hashes.

Any suggestions (I'd be happy to try patching the Velocity source, but I
had trouble making heads or tails of the parser engine)?

Thanks

Geoffrey A. Lowney 
Senior Software Development Engineer 
Recreational Equipment, Inc. 
Phone 253-395-8164 Fax 253-437-7291 
Pager 206-625-8477 2066258477@page.metrocall.com 
glowney@rei.com http://www.rei.com/



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: lost '#'s inside #literal()/#end

Posted by Shinobu Kawai <sh...@gmail.com>.
Hi Geoffrey,

> I am using VTL (with VPP) to customize a portion of a Perl script.
> Since Perl code has a lot of dollar signs, I am using #literal()/#end to
> prevent Velocity from processing most of the file.  What I find is that
> single '#' characters that are not followed by alpha text are removed
> (inside #literal()/#end).

## snip

> Any suggestions (I'd be happy to try patching the Velocity source, but I
> had trouble making heads or tails of the parser engine)?

I haven't the time right now to look into this, but you might want to
file a bugzilla issue so it doesn't get forgotten.

## Actually, I didn't realize there was such a directive until now.  I
think we also need documentation.  :)

Best regards,
-- Shinobu

--
Shinobu Kawai <sh...@gmail.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org