Note that this function doesn't validate (or "sanitize") the passed string, hence if you pass a user input to this function (which is an insecure thing to do in the first place) it might lead to unexpected behavior of loading files outside your @INC path. If you want a generic module loading function, you should check out CPAN modules such as Module::Runtime.

Returns the length of content from body if it can be calculated. If $body is an array ref it's a sum of length of each chunk, if $body is a real filehandle it's a remaining size of the filehandle, otherwise returns undef.

Load app.psgi file or a class name (like MyApp::PSGI) and require the file to get PSGI application handler. If the file can't be loaded (e.g. file doesn't exist or has a perl syntax error), it will throw an exception.

Since version 1.0006, this function would not load PSGI files from include paths (@INC) unless it looks like a class name that only consists of [A-Za-z0-9_:]. For example:

Generally speaking, passing an external input to this function is considered very insecure. If you really want to do that, validate that a given file name contains dots (like foo.psgi) and also turn it into a full path in your caller's code.

Given a header array reference, returns a convenient object that has an instance methods to access header_* functions with an OO interface. The object holds a reference to the original given $headers argument and updates the reference accordingly when called write methods like set, push or remove. It also has headers method that would return the same reference.