# RESTful web service with JSON and text representation get '/list/:offset' => sub { my $self = shift; my $numbers = [0 .. $self->param('offset')]; $self->respond_to( json => {json => $numbers}, txt => {text => join(',', @$numbers)} ); };