« blib/lib/auto/share/dist/Cmd-Dwarf/app/lib/Dwarf/Module/APIBase.pm
↑ Summary
blib/lib/auto/share/dist/Cmd-Dwarf/app/lib/Dwarf/Plugin/CORS.pm »
| 1 | package Dwarf::Pragma; | ||
| 2 | use strict; | ||
| 3 | use warnings; | ||
| 4 | use utf8; | ||
| 5 | use boolean (); | ||
| 6 | use autobox::Core; | ||
| 7 | |||
| 8 | my $utf8; | ||
| 9 | my $feature; | ||
| 10 | |||
| 11 | sub import { | ||
| 12 | my ($class, %args) = @_; | ||
| 13 | |||
| 14 | $utf8 = 1 unless defined $args{utf8}; | ||
| 15 | $feature = "5.10" unless defined $args{feature}; | ||
| 16 | |||
| 17 | warnings->import; | ||
| 18 | strict->import; | ||
| 19 | boolean->import; | ||
| 20 | boolean->export_to_level(1); | ||
| 21 | autobox::Core->import; | ||
| 22 | |||
| 23 | if ($utf8) { | ||
| 24 | utf8->import; | ||
| 25 | } | ||
| 26 | |||
| 27 | if ($feature ne 'legacy') { | ||
| 28 | require 'feature.pm'; | ||
| 29 | feature->import(":" . $feature); | ||
| 30 | } | ||
| 31 | } | ||
| 32 | |||
| 33 | sub unimport { | ||
| 34 | warnings->unimport; | ||
| 35 | strict->unimport; | ||
| 36 | boolean->unimport; | ||
| 37 | autobox::Core->unimport; | ||
| 38 | |||
| 39 | if ($utf8) { | ||
| 40 | utf8->unimport; | ||
| 41 | } | ||
| 42 | |||
| 43 | if ($feature ne 'legacy') { | ||
| 44 | feature->unimport; | ||
| 45 | } | ||
| 46 | } | ||
| 47 | |||
| 48 | 1; |