in reply to [solved] plack: close filehandle responsibility
$image->filehandle('<', ':raw') is opening the file. And it is in your code. So, your code needs to close it.
Not elegant (nor tested), but the following should work:
my $ih = $image->filehandle('<', ':raw'); my $ret = $self->res->set_content_type('image/x-icon') ->render_binary($ih); close $ih; return $ret;
Update: Rethinking this, the handle created by $image->filehandle and passed to render_binary() is being stored in some object. So, when that object gets destroyed, the handle should be automatically closed.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: plack: close filehandle responsibility
by Anonymous Monk on May 07, 2015 at 01:51 UTC | |
by RonW (Parson) on May 07, 2015 at 02:19 UTC | |
by Anonymous Monk on May 07, 2015 at 02:44 UTC |