[Catalyst] Can't use string ("AutoCommit") as a HASH ref while "strict refs" in use

Lee Standen nom at standen.id.au
Tue May 1 02:36:33 GMT 2007


Sounds like you've tried to use additional options in your connect 
details, and forgot to put them into a hash.

AutoCommit => 1

Should be:

{ AutoCommit => 1 }

Give that a go?

Dmitri Pissarenko wrote:
> Hello!
> 
> I'm new to Catalyst and now I try to make the example "Catalyst
> Tutorial - Part 2: Catalyst Application Development Basics" (
> Catalyst::Manual::Tutorial::CatalystBasics) run on for me (on a
> windows machine with ActivePerl).
> 
> However, I'm getting following exception, when I connect to
> http://localhost:3000/books/list:
> 
> Caught exception in MyApp::Controller::Books->list "Can't use string
> ("AutoCommit") as a HASH ref while "strict refs" in use at
> D:/Perl/site/lib/DBI.pm line 553."
> 
> 
> The configuation data is given below.
> 
> TIA for any hint
> 
> Dmitri Pissarenko
> 
> P. S.: Here is the full error report:
> 
> Request
> 
> bless({
>  action           => "books/list",
>  address          => "127.0.0.1",
>  arguments        => [],
>  base             => bless(do{\(my $o = "http://localhost:3000/")},
> "URI::http"),
>  body_parameters  => {},
>  captures         => [],
>  cookies          => {
>                        "MANTIS_VIEW_ALL_COOKIE" => bless({ name =>
> "MANTIS_VIEW_ALL_COOKIE", path => "/", value => [1] },
> "CGI::Simple::Cookie"),
>                        wikidbLoggedOut          => bless({ name =>
> "wikidbLoggedOut", path => "/", value => ["20070430135728"] },
> "CGI::Simple::Cookie"),
>                        wikidbUserName           => bless({
>                                                      name  => 
> "wikidbUserName",
>                                                      path  => "/",
>                                                      value =>
> ["\xD0\x94\xD0\x90\xD0\x9F"],
>                                                    }, 
> "CGI::Simple::Cookie"),
>                      },
>  headers          => bless({
>                        "accept" =>
> "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5", 
> 
>                        "accept-charset" => 
> "ISO-8859-1,utf-8;q=0.7,*;q=0.7",
>                        "accept-encoding" => "gzip,deflate",
>                        "accept-language" => "en-us,en;q=0.5",
>                        connection => "keep-alive",
>                        cookie => "wikidbUserName=%D0%94%D0%90%D0%9F;
> MANTIS_VIEW_ALL_COOKIE=1; wikidbLoggedOut=20070430135728",
>                        host => "localhost:3000",
>                        "keep-alive" => 300,
>                        "user-agent" => "Mozilla/5.0 (Windows; U;
> Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7",
>                      }, "HTTP::Headers"),
>  hostname         => "localhost",
>  match            => "books/list",
>  method           => "GET",
>  parameters       => {},
>  path             => "books/list",
>  protocol         => "HTTP/1.0",
>  query_parameters => {},
>  secure           => 0,
>  uploads          => {},
>  uri              => bless(do{\(my $o =
> "http://localhost:3000/books/list")}, "URI::http"),
>  user             => undef,
> }, "Catalyst::Request")
> 
> Response
> 
> bless({
>  body    => "",
>  cookies => {},
>  headers => bless({
>               "content-type" => "text/html; charset=utf-8",
>               "x-catalyst"   => "5.7006",
>             }, "HTTP::Headers"),
>  status  => 200,
> }, "Catalyst::Response")
> 
> Stash
> 
> {}
> 
> Config
> 
> do {
>  my $a = {
>    home => 
> "C:\\work\\business\\prog\\i5invest\\2007_04_30_sampleAppI5invest\\MyApp",
>    name => "MyApp",
>    root => bless({
>          dirs => [
>                "",
>                "work",
>                "business",
>                "prog",
>                "i5invest",
>                "2007_04_30_sampleAppI5invest",
>                "MyApp",
>                "root",
>              ],
>          file_spec_class => undef,
>          volume => "C:",
>        }, "Path::Class::Dir"),
>    stacktrace => { context => 3, verbose => 0 },
>    static => {
>          debug => 1,
>          dirs => [],
>          ignore_dirs => [],
>          ignore_extensions => ["tmpl", "tt", "tt2", "html", "xhtml"],
>          include_path => ['fix'],
>          mime_types => {},
>          no_logs => 1,
>        },
>  };
>  $a->{static}{include_path}[0] = $a->{root};
>  $a;
> }
> 
> P. P. S.: Here is the output of "perl -v":
> 
> C:\work\business\prog\i5invest\2007_04_30_sampleAppI5invest\MyApp>perl -v
> 
> This is perl, v5.8.4 built for MSWin32-x86-multi-thread
> (with 3 registered patches, see perl -V for more detail)
> 
> Copyright 1987-2004, Larry Wall
> 
> Binary build 810 provided by ActiveState Corp. http://www.ActiveState.com
> ActiveState is a division of Sophos.
> Built Jun  1 2004 11:52:21
> 
> Perl may be copied only under the terms of either the Artistic License 
> or the
> GNU General Public License, which may be found in the Perl 5 source kit.
> 
> Complete documentation for Perl, including FAQ lists, should be found on
> this system using `man perl' or `perldoc perl'.  If you have access to the
> Internet, point your browser at http://www.perl.com/, the Perl Home Page.
> 
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
> 



More information about the Catalyst mailing list