Thank you for the hint, I think I found this advent:
http://advent.perldancer.org/2014/6 .
Can I use send_file together with a template ? Let's say I want to render html with an image,
but I want to make the image available only if logged_in_user();
If it doesn't work with the send_file, the only way I see is to create a random,
temporary symlinks in public pointing to the "not public" files which will be valid during
the session and removed after the session is destroyed.
And use these temporary locations to render the protected images the usual way.
Any other ideas ?
Thank you,