Module-Generic

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN


    *   save data to a file handle (only with Storable::Improved / Storable)

    *   Return the serialised data

    The supported parameters are:

    *   "append"

        Boolean. If true, the serialised data will be appended to the given
        file. This works only in conjonction with *file*

    *   "base64"

        Thise can be set to a true value like 1, or to your preferred base64
        encoder/decoder, or to an array reference containing 2 code
        references, the first one for encoding and the second one for
        decoding.

        If this is set simply to a true value, "serialise" will call
        "_has_base64" to find out any installed base64 modules. Currently
        the ones supported are: Crypt::Misc and MIME::Base64. Of course, you
        need to have one of those modules installed first before it can be
        used.

        If this option is set and no appropriate module could be found,
        "serialise" will return an error.

    *   "file"

        String. A file path where to store the serialised data.

    *   "io"

        A file handle. This is used when the serialiser is
        Storable::Improved / Storable to call its function "store_fd" in
        Storable::Improved and "fd_retrieve" in Storable::Improved

    *   "lock"

        Boolean. If true, this will lock the file before writing to it. This
        works only in conjonction with *file* and the serialiser
        Storable::Improved

    *   "serialiser" or "serializer"

        A string being the class of the serialiser to use. This can be only
        either Sereal or Storable::Improved

    Additionally the following options are supported and passed through
    directly for each serialiser:

    *   CBOR::Free: "canonical", "string_encode_mode",
        "preserve_references", "scalar_references"

    *   CBOR: "max_depth", "max_size", "allow_unknown", "allow_sharing",
        "allow_cycles", "forbid_objects", "pack_strings", "text_keys",
        "text_strings", "validate_utf8", "filter"

    *   JSON: "allow_blessed" "allow_nonref" "allow_unknown" "allow_tags"
        "ascii" "boolean_values" "canonical" "convert_blessed"
        "filter_json_object" "filter_json_single_key_object" "indent"
        "latin1" "max_depth" "max_size" "pretty" "relaxed" "space_after"
        "space_before" "utf8"

    *   "encode" in Sereal::Decoder if the serialiser is Sereal:
        "aliased_dedupe_strings", "canonical", "canonical_refs", "compress",
        "compress_level", "compress_threshold", "croak_on_bless",
        "dedupe_strings", "freeze_callbacks", "max_recursion_depth",
        "no_bless_objects", "no_shared_hashkeys", "protocol_version",
        "snappy", "snappy_incr", "snappy_threshold", "sort_keys",
        "stringify_unknown", "undef_unknown", "use_protocol_v1",
        "warn_unknown"

    *   Storable::Improved / Storable: no option available

    If an error occurs, this sets an error and return "undef"

  serialize
    Alias for "serialise"

  set
    set() sets object inner data type and takes arguments in a hash like
    fashion:

        $obj->set( 'verbose' => 1, 'debug' => 0 );

  subclasses
    Provided with a *CLASS* value, this method try to guess all the existing
    sub classes of the provided *CLASS*.

    If *CLASS* is not provided, the class into which was blessed the calling
    object will be used instead.

    It returns an array of subclasses in list context and a reference to an
    array of those subclasses in scalar context.

    If an error occured, undef is returned and an error is set accordingly.
    The latter can be retrieved using the error method.

  true
    Returns a "true" variable from Module::Generic::Boolean

  false
    Returns a "false" variable from Module::Generic::Boolean

  verbose
    Set or get the verbosity level with an integer.

  will
    This will try to find out if an object supports a given method call and
    returns the code reference to it or undef if none is found.

  AUTOLOAD
    The special AUTOLOAD() routine is called by perl when no matching
    routine was found in the module.

    AUTOLOAD() will then try hard to process the request. For example, let's
    assue we have a routine foo.

    It will first, check if an equivalent entry of the routine name that was



( run in 0.530 second using v1.01-cache-2.11-cpan-df04353d9ac )