[Dancer-users] Managing "sessions" for each open browser window

Assaf Gordon gordon at cshl.edu
Mon Oct 1 21:55:41 CEST 2012


Stefan Hornburg (Racke) wrote, On 10/01/2012 03:29 PM:
> On 10/01/2012 08:54 PM, Assaf Gordon wrote:
>>
>> Trying to run the example website with Dancer2 gives:
>> ===
>> $ cd ./Dancer-Plugin-WindowSession/eg/example
>> $ perl -I/home/gordon/sources/Dancer2/lib/ bin/app.pl
>> Eval went very, very wrong:
>> [ and the list goes on and on and on until: ]
>> Number found where operator expected at (eval 89) line 18, near "->1"
>> BEGIN failed--compilation aborted at bin/app.pl line 2.
>> ===
>>
>> Not sure even where to start fixing this...
>>
> 
> Please try to use plugin_args inside your plugin (see Dancer::Plugin for more
> information).
> 

I don't think it's a runtime problem (parsing parameters of my subs) - this errors happens during compilation (perhaps because some of the config parsing happens during compilation in some "BEGIN" block? I seem to remember encountering similar annoyances with Dancer 1 when there were problems in the config file).

Anyway, trying with "perl -d" shows the following stack-trace even before showing the debug prompt.
Maybe you'll spot something obvious that I missed...
===
[... lots of messages ... ] called at /usr/local/share/perl/5.14.2/Sub/Quote.pm line 5
	Sub::Quote::_clean_eval('local *Dancer::Core::Role::Engine::config;\x{a}local *Dancer::Cor...', 'ARRAY(0x2a3ed20)') called at /usr/local/share/perl/5.14.2/Sub/Quote.pm line 95
	Sub::Quote::_unquote_all_outstanding() called at /usr/local/share/perl/5.14.2/Sub/Quote.pm line 137
	Sub::Quote::unquote_sub('CODE(0x3441f98)') called at /usr/local/share/perl/5.14.2/Method/Generate/Constructor.pm line 32
	Method::Generate::Constructor::__ANON__[/usr/local/share/perl/5.14.2/Method/Generate/Constructor.pm:35]() called at /usr/local/share/perl/5.14.2/Sub/Defer.pm line 16
	Sub::Defer::undefer_sub('CODE(0x3439ed8)') called at /usr/local/share/perl/5.14.2/Sub/Defer.pm line 38
	Sub::Defer::__ANON__[/usr/local/share/perl/5.14.2/Sub/Defer.pm:39]('Dancer::Session::YAML', 'environment', 'development', 'location', '/home/gordon/projects/Dancer-Plugin-WindowSession/eg/example/...', 'postponed_hooks', 'HASH(0x2e995a8)', 'session_dir', '/home/gordon/projects/Dancer-Plugin-WindowSession/eg/example/...', ...) called at /home/gordon/sources/Dancer2/lib//Dancer/Factory/Engine.pm line 19
	Dancer::Factory::Engine::create('Dancer::Factory::Engine', 'session', 'YAML', 'environment', 'development', 'location', '/home/gordon/projects/Dancer-Plugin-WindowSession/eg/example/...', 'session_dir', '/home/gordon/projects/Dancer-Plugin-WindowSession/eg/example/...', ...) called at /home/gordon/sources/Dancer2/lib//Dancer/Core/Role/Config.pm line 211
	Dancer::Core::Role::Config::__ANON__[/home/gordon/sources/Dancer2/lib//Dancer/Core/Role/Config.pm:214]('Dancer::Core::Runner=HASH(0x2e83198)', 'YAML', 'HASH(0x2f291b8)') called at /home/gordon/sources/Dancer2/lib//Dancer/Core/Role/Config.pm line 266
	Dancer::Core::Role::Config::_compile_config_entry('Dancer::Core::Runner=HASH(0x2e83198)', 'session', 'YAML', 'HASH(0x2f291b8)') called at /home/gordon/sources/Dancer2/lib//Dancer/Core/Role/Config.pm line 154
	Dancer::Core::Role::Config::_compile_config('Dancer::Core::Runner=HASH(0x2e83198)', 'HASH(0x2f291b8)') called at /home/gordon/sources/Dancer2/lib//Dancer/Core/Role/Config.pm line 122
	Dancer::Core::Role::Config::_build_config('Dancer::Core::Runner=HASH(0x2e83198)') called at (eval 23)[(eval 22)[/usr/local/share/perl/5.14.2/Sub/Quote.pm:5]:29] line 44
	Dancer::Core::Role::Config::config('Dancer::Core::Runner=HASH(0x2e83198)') called at /home/gordon/sources/Dancer2/lib//Dancer.pm line 67
	Dancer::import('Dancer') called at bin/app.pl line 2
	main::BEGIN() called at (eval 92)[(eval 91)[/usr/local/share/perl/5.14.2/Sub/Quote.pm:5]:11] line 31
	eval {...} called at (eval 92)[(eval 91)[/usr/local/share/perl/5.14.2/Sub/Quote.pm:5]:11] line 31
 at /usr/local/share/perl/5.14.2/Sub/Quote.pm line 96
	Sub::Quote::_unquote_all_outstanding() called at /usr/local/share/perl/5.14.2/Sub/Quote.pm line 137
	Sub::Quote::unquote_sub('CODE(0x3441f98)') called at /usr/local/share/perl/5.14.2/Method/Generate/Constructor.pm line 32
	Method::Generate::Constructor::__ANON__[/usr/local/share/perl/5.14.2/Method/Generate/Constructor.pm:35]() called at /usr/local/share/perl/5.14.2/Sub/Defer.pm line 16
	Sub::Defer::undefer_sub('CODE(0x3439ed8)') called at /usr/local/share/perl/5.14.2/Sub/Defer.pm line 38
	Sub::Defer::__ANON__[/usr/local/share/perl/5.14.2/Sub/Defer.pm:39]('Dancer::Session::YAML', 'environment', 'development', 'location', '/home/gordon/projects/Dancer-Plugin-WindowSession/eg/example/...', 'postponed_hooks', 'HASH(0x2e995a8)', 'session_dir', '/home/gordon/projects/Dancer-Plugin-WindowSession/eg/example/...', ...) called at /home/gordon/sources/Dancer2/lib//Dancer/Factory/Engine.pm line 19
	Dancer::Factory::Engine::create('Dancer::Factory::Engine', 'session', 'YAML', 'environment', 'development', 'location', '/home/gordon/projects/Dancer-Plugin-WindowSession/eg/example/...', 'session_dir', '/home/gordon/projects/Dancer-Plugin-WindowSession/eg/example/...', ...) called at /home/gordon/sources/Dancer2/lib//Dancer/Core/Role/Config.pm line 211
	Dancer::Core::Role::Config::__ANON__[/home/gordon/sources/Dancer2/lib//Dancer/Core/Role/Config.pm:214]('Dancer::Core::Runner=HASH(0x2e83198)', 'YAML', 'HASH(0x2f291b8)') called at /home/gordon/sources/Dancer2/lib//Dancer/Core/Role/Config.pm line 266
	Dancer::Core::Role::Config::_compile_config_entry('Dancer::Core::Runner=HASH(0x2e83198)', 'session', 'YAML', 'HASH(0x2f291b8)') called at /home/gordon/sources/Dancer2/lib//Dancer/Core/Role/Config.pm line 154
	Dancer::Core::Role::Config::_compile_config('Dancer::Core::Runner=HASH(0x2e83198)', 'HASH(0x2f291b8)') called at /home/gordon/sources/Dancer2/lib//Dancer/Core/Role/Config.pm line 122
	Dancer::Core::Role::Config::_build_config('Dancer::Core::Runner=HASH(0x2e83198)') called at (eval 23)[(eval 22)[/usr/local/share/perl/5.14.2/Sub/Quote.pm:5]:29] line 44
	Dancer::Core::Role::Config::config('Dancer::Core::Runner=HASH(0x2e83198)') called at /home/gordon/sources/Dancer2/lib//Dancer.pm line 67
	Dancer::import('Dancer') called at bin/app.pl line 2
	main::BEGIN() called at bin/app.pl line 2
	eval {...} called at bin/app.pl line 2
BEGIN failed--compilation aborted at bin/app.pl line 2.
 at bin/app.pl line 2
Debugged program terminated.  Use q to quit or R to restart,
  use o inhibit_exit to avoid stopping after program termination,
  h q, h R or h o to get additional info.  
  DB<1> 
===




More information about the Dancer-users mailing list