Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

The error in the title is the result of a common TT2 "gotcha" . The solution is to give INCLUDE_PATH an arrayref, so a windows-style-directory isn't confused for a unix-style $PATH ( colon:s:e:p:a:r:a:t:e:d:list:of:directories )

diff -ruN old/Base.pm new/Base.pm --- old/Base.pm 2011-05-04 09:06:57.000000000 -0700 +++ new/Base.pm 2012-05-12 02:55:35.171875000 -0700 @@ -95,11 +95,14 @@ debug "Processing template $tmpl\n"; my $out; + my %dconf = $me->tt_config; # Hook for sub-classes to add config + $dconf{INCLUDE_PATH} = [ $dconf{INCLUDE_PATH} ] if not ref $dconf +{INCLUDE_PATH} my $tt = Template->new( #DEBUG => $me->translator->debug, + #DEBUG => Template::Constants::DEBUG_ALL(), ABSOLUTE => 1, # Set so we can use from the command line sen +sibly - RELATIVE => 1, # Maybe the cmd line code should set it! Secu +rity! - $me->tt_config, # Hook for sub-classes to add config +# RELATIVE => 1, # Maybe the cmd line code should set it! Sec +urity! + %dconf, %args, # Allow any TT opts to be passed in the produ +cer_args ) || die "Failed to initialize Template object: ".Template->error +; @@ -107,7 +110,7 @@ $me->tt_default_vars, $me->tt_vars, # Sub-class hook for adding vars }, \$out ) - or die "Error processing template '$tmpl': ".$tt->error; + or die "Error processing template '$tmpl': ".$tt->error ; return $out; }

After that, the following generates output

sqlt -f SQLite -t -t DiaUml input > output

But naturally, foreign keys /UML relations are on the TODO list ;)

  • Comment on error - schema.tt2: not found SQL/Translator/Producer/TT/Base.pm line 106. (solution template INCLUDE_PATH array)
  • Download Code

Replies are listed 'Best First'.
Re: error - schema.tt2: not found SQL/Translator/Producer/TT/Base.pm line 106. (solution template INCLUDE_PATH array)
by choroba (Cardinal) on May 12, 2012 at 12:02 UTC
    No semicolon after line 9?

      No semicolon after line 9?

      Thanks, copy/paste error