Skip to content

Instantly share code, notes, and snippets.

@eviltik
Created December 25, 2014 14:11
Show Gist options
  • Save eviltik/a64843f904e7f97b2961 to your computer and use it in GitHub Desktop.
Save eviltik/a64843f904e7f97b2961 to your computer and use it in GitHub Desktop.
mojolicious: Can't use string ("json") as a HASH ref while "strict refs" in use
Versions:
CORE
Perl (v5.14.2, linux)
Mojolicious (5.70, Tiger Face)
OPTIONAL
EV 4.0+ (not installed)
IO::Socket::Socks 0.64+ (not installed)
IO::Socket::SSL 1.84+ (1.999)
Net::DNS::Native 0.14+ (not installed)
Code:
use Mojo::Base 'Mojolicious';
sub startup {
my $self = shift;
my $r = $self->routes;
$r->get('/test')->render(json => {x => 3});
}
Error at startup:
Can't load application from file "/var/www/GGCC/script/test": Can't use string ("json") as a HASH ref while "strict refs" in use at /usr/local/share/perl/5.14.2/Mojolicious/Routes/Pattern.pm line 63.
@eviltik
Copy link
Author

eviltik commented Dec 25, 2014

you just can not "render" a "route", noob mistake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment