.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" 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 .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Modern::Perl 3pm" .TH Modern::Perl 3pm "2020-02-11" "perl v5.30.0" "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" Modern::Perl \- enable all of the features of Modern Perl with one import .SH "VERSION" .IX Header "VERSION" version 1.20200211 .SH "SYNOPSIS" .IX Header "SYNOPSIS" Modern Perl programs use several modules to enable additional features of Perl and of the \s-1CPAN.\s0 Instead of copying and pasting all of these \f(CW\*(C`use\*(C'\fR lines, instead write only one: .PP .Vb 1 \& use Modern::Perl; .Ve .PP This enables the strict and warnings pragmas, as well as all of the features available in Perl 5.10. It also enables C3 method resolution order as documented in \f(CW\*(C`perldoc mro\*(C'\fR and loads IO::File and IO::Handle so that you may call methods on filehandles. In the future, it may include additional core modules and pragmas (but is unlikely to include non-core features). .PP Because so much of this module's behavior uses lexically scoped pragmas, you may disable these pragmas within an inner scope with: .PP .Vb 1 \& no Modern::Perl; .Ve .PP See for more information, for further discussion of Modern Perl and its implications, and for a freely-downloadable Modern Perl tutorial. .SS "\s-1CLI\s0 Usage" .IX Subsection "CLI Usage" As of Modern::Perl 2019, you may also enable this pragma from the command line: .PP .Vb 1 \& $ perl \-Modern::Perl \-e \*(Aqsay "Take that, awk!"\*(Aq .Ve .PP You may also enable year-specific features: .PP .Vb 1 \& $ perl \-Modern::Perl=2020 \-e \*(Aqsay "Looking forward to Perl 5.30!"\*(Aq .Ve .SS "Wrapping Modern::Perl" .IX Subsection "Wrapping Modern::Perl" If you want to wrap Modern::Perl in your own \f(CW\*(C`import()\*(C'\fR method, you can do so to add additional pragmas or features, such as the use of Try::Tiny. Please note that, if you do so, you will \fInot\fR automatically enable C3 method resolution in the calling scope. This is due to how the mro pragma works. In your custom \f(CW\*(C`import()\*(C'\fR method, you will need to write code such as: .PP .Vb 1 \& mro::set_mro( scalar caller(), \*(Aqc3\*(Aq ); .Ve .SS "Forward Compatibility" .IX Subsection "Forward Compatibility" For forward compatibility, I recommend you specify a string containing a \&\fIyear\fR value as the single optional import tag. For example: .PP .Vb 2 \& use Modern::Perl \*(Aq2009\*(Aq; \& use Modern::Perl \*(Aq2010\*(Aq; .Ve .PP \&... both enable 5.10 features, while: .PP .Vb 1 \& use Modern::Perl \*(Aq2011\*(Aq; .Ve .PP \&... enables 5.12 features: .PP .Vb 1 \& use Modern::Perl \*(Aq2012\*(Aq; .Ve .PP \&... enables 5.14 features: .PP .Vb 1 \& use Modern::Perl \*(Aq2013\*(Aq; .Ve .PP \&... enables 5.16 features, and: .PP .Vb 1 \& use Modern::Perl \*(Aq2014\*(Aq; .Ve .PP \&... enables 5.18 features, and: .PP .Vb 1 \& use Modern::Perl \*(Aq2015\*(Aq; .Ve .PP \&... enables 5.20 features, and: .PP .Vb 1 \& use Modern::Perl \*(Aq2016\*(Aq; .Ve .PP \&... enables 5.24 features, and: .PP .Vb 1 \& use Modern::Perl \*(Aq2017\*(Aq; .Ve .PP \&... enables 5.24 features, and: .PP .Vb 1 \& use Modern::Perl \*(Aq2018\*(Aq; .Ve .PP \&... enables 5.26 features. .PP Obviously you cannot use newer features on earlier versions. Perl will throw the appropriate exception if you try. .SH "AUTHOR" .IX Header "AUTHOR" chromatic, \f(CW\*(C`\*(C'\fR .SH "BUGS" .IX Header "BUGS" None known. .PP Please report any bugs or feature requests to \f(CW\*(C`bug\-modern\-perl at rt.cpan.org\*(C'\fR, or through the web interface at . I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. .SH "SUPPORT" .IX Header "SUPPORT" You can find documentation for this module with the perldoc command. .PP .Vb 1 \& perldoc Modern::Perl .Ve .PP You can also look for information at: .IP "\(bu" 4 \&\s-1RT: CPAN\s0's request tracker .Sp .IP "\(bu" 4 AnnoCPAN: Annotated \s-1CPAN\s0 documentation .Sp .IP "\(bu" 4 \&\s-1CPAN\s0 Ratings .Sp .IP "\(bu" 4 Search \s-1CPAN\s0 .Sp .SH "ACKNOWLEDGEMENTS" .IX Header "ACKNOWLEDGEMENTS" Damian Conway (inspiration from Toolkit), Florian Ragwitz (B::Hooks::Parser, so I didn't have to write it myself), chocolateboy (for suggesting that I don't even need B::Hooks::Parser), Damien Learns Perl, David Moreno, Evan Carroll, Elliot Shank, Andreas König, Father Chrysostomos, Gryphon Shafer, and Norbert E. Grüner for reporting bugs, filing patches, and requesting features. .SH "AUTHOR" .IX Header "AUTHOR" chromatic .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2018 by chromatic@wgz.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.