Skip to content

Instantly share code, notes, and snippets.

View augensalat's full-sized avatar

Bernhard Graf augensalat

  • Berlin, Germany
View GitHub Profile
#!/usr/bin/env perl
use strict;
use warnings;
use Mojo::IOLoop;
use Mojo::UserAgent;
# Build a normal transaction
my $ua = Mojo::UserAgent->new;
@augensalat
augensalat / gist:3699443
Created September 11, 2012 14:59
Simple Mojolicious::Lite upload
#!/usr/bin/env perl
use Mojolicious::Lite;
any '/upload' => sub {
my $self = shift;
# Check file size
return $self->render(text => 'File is too big.', status => 200)
if $self->req->is_limit_exceeded;