Created
August 9, 2016 15:11
-
-
Save jehdin007/589bf68b7f06d83357e9bf460a22acc0 to your computer and use it in GitHub Desktop.
How I'm creating a filehandle for my script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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