Skip to content

Instantly share code, notes, and snippets.

@jehdin007
Created August 9, 2016 15:11
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 jehdin007/589bf68b7f06d83357e9bf460a22acc0 to your computer and use it in GitHub Desktop.
Save jehdin007/589bf68b7f06d83357e9bf460a22acc0 to your computer and use it in GitHub Desktop.
How I'm creating a filehandle for my script
post '/upload' => sub {
my $self = shift;
$self = $self->inactivity_timeout(3600);
my $upload_path = "download/";
my $filename = $upload_path . $upload->filename;
$upload->move_to($filename);
my $file_handle = new FileHandle($filename);
my $report = Tools::Report->new( {'file_handle' => $file_handle} ); #Object
die $report unless ref $report;
$self->stash( report => $report ); #ObjRef
$self->render('upload');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment