May be scalar virtual method "replace()" is the most suitable for this task.
See perldoc Template::Manual::VMethod-->"Scalar Virtual 
Methods"-->"replace(search, replace)"

On Mon, 5 Sep 2005 14:27:36 +0100
Stephen Quinney <[EMAIL PROTECTED]> wrote:

>SQ > I have two variables and I want to remove the contents of one from the
>SQ > other. The situation in this case is a directory name (dir) and a
>SQ > filename (name) which is an absolute path. I want to display the
>SQ > filename part only with the directories removed.
>SQ > 
>SQ > I have tried various things along these lines:
>SQ > 
>SQ > [% SET dir  = "/a/b/c/d/e/"
>SQ >        name = "/a/b/c/d/e/d.txt" %]
>SQ > [% name | remove("^\Q$dir\E") %]
>SQ > 
>SQ > but I am getting nowhere, can someone help me with how I can actually
>SQ > achieve this aim?
>SQ > 
>SQ > Thanks,
>SQ > 
>SQ > Stephen Quinney
>SQ > 
>SQ > _______________________________________________
>SQ > templates mailing list
>SQ > [email protected]
>SQ > http://lists.template-toolkit.org/mailman/listinfo/templates


-- 
WBR dyker
Agava Software

_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to