File: sense.pm.PL

package info (click to toggle)
libcommon-sense-perl 3.75-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 168 kB
  • sloc: makefile: 18
file content (73 lines) | stat: -rwxr-xr-x 1,532 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#! perl-000

our $VERSION = 3.75;

open STDOUT, ">$ARGV[0]~"
   or die "$ARGV[0]~: $!";

our ($WARN, $H, %H);

use utf8;
use strict qw(subs vars);

BEGIN {
   if ($] >= 5.010) {
      require feature;
      feature->import (qw(say state switch));
   }
   if ($] >= 5.012) {
      feature->import (qw(unicode_strings));
   }
   if ($] >= 5.016) {
      feature->import (qw(current_sub fc evalbytes));
      feature->unimport (qw(array_base));
   }

}

no warnings;
use warnings qw(FATAL closed threads internal debugging pack malloc prototype
                inplace io pipe unpack glob digit printf
                layer reserved taint closure semicolon);
no warnings qw(exec newline unopened);

BEGIN {
   $H    = $^H;
   $WARN = ${^WARNING_BITS};
   %H    = %^H;
}

while (<DATA>) {
   if (/^IMPORT/) {
      print "   # use warnings\n";
      printf "   \${^WARNING_BITS} ^= \${^WARNING_BITS} ^ \"%s\";\n",
             join "", map "\\x$_", unpack "(H2)*", $WARN;
      print "   # use strict, use utf8; use feature;\n";
      printf "   \$^H |= 0x%x;\n", $H;

      if (my @features = grep /^feature_/, sort keys %H) {
         print "   \@^H{qw(@features)} = (1) x ", (scalar @features), ";\n";
      }
   } elsif (/^VERSION/) {
      print "our \$VERSION = $VERSION;\n";
   } else {
      print;
   }
}

close STDOUT;
rename "$ARGV[0]~", $ARGV[0];

__DATA__
package common::sense;

VERSION

# overload should be included

sub import {
   local $^W; # work around perl 5.16 spewing out warnings for next statement
IMPORT
}

1