in reply to Can't locate object method "new" via package "Class::DBI::SQL::Transformer" at C

The mechanism PAR uses to pick up all the modules your program needs (Module::ScanDeps), is not perfect. This is especially so with .pm modules that are indirectly required by Class::DBI - I've been bitten by this one.

If you unzip -l the exe, you can see what's inside it (on Windows, you can browse the contents with winzip and suchlike).

If your Transformer.pm is missing, you can explicitly add it by using the Modules textarea in tkpp. Or, you can fix the problem in code by putting an explicit use Class::DBI::SQL::Transformer, and any other modules that are missing, into your .pl script.

--

Oh Lord, won’t you burn me a Knoppix CD ?
My friends all rate Windows, I must disagree.
Your powers of persuasion will set them all free,
So oh Lord, won’t you burn me a Knoppix CD ?
(Missquoting Janis Joplin)

Replies are listed 'Best First'.
Re^2: Can't locate object method "new" via package "Class::DBI::SQL::Transformer" at C
by mikasue (Friar) on Nov 18, 2006 at 20:06 UTC
    Thanks for your reply. I included the Class::DBI::SQL::Transformer in my script but then I got the following warnings. Did these warnings ever appear for you?

    Subroutine new redefined at C:/Perl/site/lib/Class/DBI/SQL/Transformer.pm line 3 2.
    Subroutine sql redefined at C:/Perl/site/lib/Class/DBI/SQL/Transformer.pm line 5 5.
    Subroutine args redefined at C:/Perl/site/lib/Class/DBI/SQL/Transformer.pm line 61.
    Subroutine _expand_table redefined at C:/Perl/site/lib/Class/DBI/SQL/Transformer .pm line 67.
    Subroutine _expand_join redefined at C:/Perl/site/lib/Class/DBI/SQL/Transformer. pm line 77.
    Subroutine _do_transformation redefined at C:/Perl/site/lib/Class/DBI/SQL/Transf ormer.pm line 108.

      Looks like the Transformer.pm module code is being pulled in twice. Are you using "use" or "require"? "use" has an internal mechanism which stops this duplicate loading from happening.

      If you post the code, I should be able to tell what is wrong.

      --

      Oh Lord, won’t you burn me a Knoppix CD ?
      My friends all rate Windows, I must disagree.
      Your powers of persuasion will set them all free,
      So oh Lord, won’t you burn me a Knoppix CD ?
      (Missquoting Janis Joplin)

        um I used use not require

        I took that out and the warnings went away but my original problem stands. Thanks anyway for your help.