Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Not quite.

use v5.20;

is closer to

BEGIN { require v5.20; } no feature qw( :all ); # `use v5.10;`+ use feature qw( :5.20 ); # `use v5.10;`+ use strict; # `use v5.12;`+ #use warnings; # `use v5.35;`+

So you want

require v5.20; feature->unimport::out_of( $caller, ':all' ); # `use v5.10;`+ feature->import::into( $caller, ':5.20' ); # `use v5.10;`+ strict->import::into( $caller ); # `use v5.12;`+ #warnings->import::into( $caller ); # `use v5.35;`+

Turning off all features first is especially important with 5.35+ because use v5.35; and higher turn off features which are enabled by default. Specifically,

  • use v5.35; and higher turns off the indirect and multidimensional normally-enabled features, and
  • use v5.37; and higher turns off the bareword_filehandles normally-enabled feature
$ perl -e'use v5.35; abc def;' Bareword found where operator expected (Do you need to predeclare "abc +"?) at -e line 1, near "abc def" syntax error at -e line 1, near "abc def" Execution of -e aborted due to compilation errors. $ perl -e'use feature qw( :5.35 ); abc def;' Can't locate object method "abc" via package "def" (perhaps you forgot + to load "def"?) at -e line 1. $ perl -e'no feature qw( :all ); use feature qw( :5.35 ); abc def;' Bareword found where operator expected (Do you need to predeclare "abc +"?) at -e line 1, near "abc def" syntax error at -e line 1, near "abc def" Execution of -e aborted due to compilation errors.

In reply to Re^3: how to import::into v5.020 by ikegami
in thread how to import::into v5.020 by M4

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-19 02:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found