package MyApp::RESTful; use warnings; use strict; use REST::Application; use base 'REST::Application'; sub new { my $self = shift; my $args = shift; my $app = {}; $app->{'dbh'} = DBI->connect(); $app->{'cfg'} = Config::Simple->new(); $app->{'__defaultQuery'} = CGI->new(); . . . . . . bless $app, $self; return $app; } sub setup { my $self = shift; $self->resourceHooks( qr{/sd/agent/create/(.*)$} => '_AgentCreate', qr{/sd/agent/password/change/(.*)$} => '_AgentPWChange', qr{/sd/agent/logout/(.*)$} => '_AgentLogOut', qr{/sd/agent/stats/(.*)$} => '_AgentJobStats', qr{/sd/agent/authentication/(.*)$} => '_AgentAuthenticate' ); }