[Templates] DELIMITER => '|'

Brad Bowman bsb@bereft.net
Tue, 01 Aug 2006 15:25:48 +1000


Hello,

While trying to debug a tt2 program on Windows I set the
DELIMITER option to '|' and got the following error:

  file error - INCLUDE_PATH exceeds 64 directories

Which I think results indirectly from:

    # coerce INCLUDE_PATH to an array ref, if not already so
    $path = [ split(/$dlim/, $path) ]
        unless ref $path eq 'ARRAY';

  "/usr/lib/perl5/Template/Provider.pm" line 353

The '|' is interpreted as a regex metachar instead of a literal.
This surprised me and the error message was a also misleading.

If the DELIMITER should be a literal then a \Q is needed, but
that would break this line (earlier in Provider.pm)
  $dlim = ($^O eq 'MSWin32') ? ':(?!\\/)' : ':';

Alternatively, and preferably in my view, DELIMITER could just be
documented as a split pattern.

This is TT2 version 2.14.

Thanks,

Brad

-- 
People with intelligence will use it to fashion both true and false and will
try to push through whatever they want with their clever reasoning.  This is
injury from intelligence.
  Nothing you do will have effect if you do not use truth. -- Hagakure