.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Function::Fallback::CoreOrPP 3pm" .TH Function::Fallback::CoreOrPP 3pm "2017-01-22" "perl v5.24.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Function::Fallback::CoreOrPP \- Functions that use non\-core XS module but provide pure\-Perl/core fallback .SH "VERSION" .IX Header "VERSION" This document describes version 0.08 of Function::Fallback::CoreOrPP (from Perl distribution Function-Fallback-CoreOrPP), released on 2017\-01\-14. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Function::Fallback::CoreOrPP qw(clone unbless uniq); \& \& my $clone = clone({blah=>1}); \& my $unblessed = unbless($blessed_ref); \& my @uniq = uniq(1, 3, 2, 1, 4); # \-> (1, 3, 2, 4) .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module provides functions that use non-core \s-1XS\s0 modules (for best speed, reliability, feature, etc) but falls back to those that use core \s-1XS\s0 or pure-Perl modules when the non-core \s-1XS\s0 module is not available. .PP This module helps when you want to bootstrap your Perl application with a portable, dependency-free Perl script. In a vanilla Perl installation (having only core modules), you can use App::FatPacker to include non-core pure-Perl dependencies to your script. .SH "FUNCTIONS" .IX Header "FUNCTIONS" .ie n .SS "clone($data) => $cloned" .el .SS "clone($data) => \f(CW$cloned\fP" .IX Subsection "clone($data) => $cloned" Try to use Data::Clone's \f(CW\*(C`clone\*(C'\fR, but fall back to using Clone::PP's \&\f(CW\*(C`clone\*(C'\fR. .ie n .SS "clone_list(@data) => @data" .el .SS "clone_list(@data) => \f(CW@data\fP" .IX Subsection "clone_list(@data) => @data" A shortcut for: .PP .Vb 1 \& return map {clone($_)} @data .Ve .ie n .SS "unbless($ref) => $unblessed_ref" .el .SS "unbless($ref) => \f(CW$unblessed_ref\fP" .IX Subsection "unbless($ref) => $unblessed_ref" Try to use Acme::Damn's \f(CW\*(C`damn\*(C'\fR to unbless a reference but fall back to shallow copying. .PP \&\s-1NOTE: \s0\f(CW\*(C`damn()\*(C'\fR \fB\s-1MODIFIES\s0\fR the original reference. (\s-1XXX\s0 in the future an option to clone the reference first will be provided), while shallow copying will return a shallow copy. .PP \&\s-1NOTE:\s0 The shallow copy method currently only handles blessed {scalar,array,hash}ref as those are the most common. .ie n .SS "uniq(@ary) => @uniq_ary" .el .SS "uniq(@ary) => \f(CW@uniq_ary\fP" .IX Subsection "uniq(@ary) => @uniq_ary" Try to use List::MoreUtils's \f(CW\*(C`uniq\*(C'\fR, but fall back to using slower, pure-Perl implementation. .SH "HOMEPAGE" .IX Header "HOMEPAGE" Please visit the project's homepage at . .SH "SOURCE" .IX Header "SOURCE" Source repository is at . .SH "BUGS" .IX Header "BUGS" Please report any bugs or feature requests on the bugtracker website .PP When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. .SH "SEE ALSO" .IX Header "SEE ALSO" Clone::Any can also uses multiple backends, but I avoid it because I don't think Storable's \f(CW\*(C`dclone\*(C'\fR should be used (no Regexp support out of the box + must use deparse to handle coderefs). .SH "AUTHOR" .IX Header "AUTHOR" perlancar .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2017 by perlancar@cpan.org. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.