add new comparison method rgb_difference that resembles arithmetical difference per...
[imager.git] / regops.perl
index fd4f32e73c416316e3631e6fb132c855cc1d549e..4c23aabd5ccbb40b0c72b2d5019296f8165c7e33 100644 (file)
@@ -5,14 +5,16 @@ my $in = shift or die "No input name";
 my $out = shift or die "No output name";
 open(IN, $in) or die "Cannot open input $in: $!";
 open(OUT, "> $out") or die "Cannot create $out: $!";
+binmode OUT;
 print OUT <<'EOS';
 # AUTOMATICALLY GENERATED BY regops.perl
 package Imager::Regops;
+use 5.006;
 use strict;
 require Exporter;
-use vars qw(@ISA @EXPORT @EXPORT_OK %Attr $MaxOperands $PackCode);
-@ISA = qw(Exporter);
-@EXPORT_OK = qw(%Attr $MaxOperands $PackCode);
+our @ISA = qw(Exporter);
+our @EXPORT_OK = qw(%Attr $MaxOperands $PackCode);
+our $VERSION = "1.000";
 
 EOS
 my @ops;
@@ -43,12 +45,12 @@ while (<IN>) {
     $reg_pack = $1; 
   }
 }
-print OUT "\n\@EXPORT = qw(@ops);\n\n";
+print OUT "\nour \@EXPORT = qw(@ops);\n\n";
 # previously we used Data::Dumper, with Sortkeys() 
 # to make sure the generated code only changed when the data
 # changed.  Unfortunately Sortkeys isn't supported in some versions of
 # perl we try to support, so we now generate this manually
-print OUT "%Attr =\n  (\n";
+print OUT "our %Attr =\n  (\n";
 for my $opname (sort keys %attr) {
   my $op = $attr{$opname};
   print OUT "  '$opname' =>\n    {\n";
@@ -72,8 +74,8 @@ for my $opname (sort keys %attr) {
   print OUT "    },\n";
 }
 print OUT "  );\n";
-print OUT "\$MaxOperands = $max_opr;\n";
-print OUT qq/\$PackCode = "$reg_pack";\n/;
+print OUT "our \$MaxOperands = $max_opr;\n";
+print OUT qq/our \$PackCode = "$reg_pack";\n/;
 print OUT <<'EOS';
 1;
 
@@ -81,7 +83,7 @@ __END__
 
 =head1 NAME
 
-Imager::Regops - generated information about the register based VM
+Imager::Regops - generated information about the register based virtual machine
 
 =head1 SYNOPSIS
 
@@ -95,7 +97,7 @@ Imager::Regops - generated information about the register based VM
 
 =head1 DESCRIPTION
 
-This module is generated automatically from regmach.h so we don't need to 
+This module is generated automatically from F<regmach.h> so we don't need to
 maintain the same information in at least one extra place.
 
 At least that's the idea.