Skip to content

Instantly share code, notes, and snippets.

@brianmed
Created June 6, 2016 21:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianmed/358911826baa2451ec84a4991a05a84a to your computer and use it in GitHub Desktop.
Save brianmed/358911826baa2451ec84a4991a05a84a to your computer and use it in GitHub Desktop.
Mojolicious plugin with shared data structure
#!/usr/bin/env perl
package Blah;
our $domain = {
template => "Joy",
};
package main;
use Mojolicious::Lite;
plugin Config => { file => "hostA" };
get '/' => sub {
my $c = shift;
$c->render(text => $c->app->config->{text});
};
app->start;
{
text => $Blah::domain->{template} . " yellow",
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment