The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

MVC::Neaf::Util - Some static functions for Not Even A Framework

DESCRIPTION

This module is probably of no use by itself. See MVC::Neaf.

EXPORT

This module optionally exports anything it has.

http_date

Return a date in format required by HTTP standard for cookies and cache expiration.

    Expires=Wed, 13 Jan 2021 22:23:01 GMT;

canonize_path( path, want_slash )

Convert '////fooo//bar/' to '/foo/bar' and '//////' to either '' or '/'.

path_prefixes ($path)

List ('', '/foo', '/foo/bar') for '/foo/bar'

rex( $string || qr/r.e.g.e.x/ )

Convert string or regex to an anchored regex.

run_all( [CODE, ...], @args )

Run all subroutines in array. Exceptions not handled. Return nothing.

run_all_nodie( [CODE, ...], $on_error, @args )

Run all subroutines in array, even if some die.

Execute on_error in such cases.

Return number of failed callbacks.

maybe_list

    maybe_list( \$value, @defaults )

If $value is undef, replace is with a copy of \@defaults.

If $value is a list, leave it as is.

Otherwise, replace $value with [ $value ].

JSON()

Because JSON::MaybeXS is not available on all systems, try to load it or emulate it.

encode_json

decode_json

These two are reexported from whatever JSON module we were lucky enough to load.

LICENSE AND COPYRIGHT

This module is part of MVC::Neaf suite.

Copyright 2016-2018 Konstantin S. Uvarin khedin@cpan.org.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.