/usr/share/perl5/Constant/Generate/Dualvar.pm is in libconstant-generate-perl 0.17-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | package Constant::Generate::Dualvar::_Overloaded;
use constant {
FLD_INT => 0,
FLD_STR => 1
};
#Stolen from:
#http://perldoc.perl.org/overload.html
sub new { my $p = shift; bless [@_], $p }
use overload '""' => \&str, '0+' => \&num, fallback => 1;
sub num {shift->[0]}
sub str {shift->[1]}
BEGIN {
$INC{'Constant/Generate/Dualvar/_Overloaded.pm'} = 1;
}
package Constant::Generate::Dualvar;
use strict;
use warnings;
use Scalar::Util;
use base qw(Exporter);
our @EXPORT_OK = qw(CG_dualvar);
our $USE_SCALAR_UTIL;
sub CG_dualvar($$);
BEGIN {
$USE_SCALAR_UTIL = eval 'use List::Util::XS 1.20; $List::Util::XS::VERSION;';
if($USE_SCALAR_UTIL) {
*CG_dualvar = \&Scalar::Util::dualvar;
} else {
require Constant::Generate::Stringified::_Overloaded;
warn "Scalar::Util::XS not available. Falling back to using overload";
*CG_dualvar = sub($$) {
my ($num,$string) = @_;
return Constant::Generate::Stringified::_Overloaded->new(
$num,$string);
}
}
}
sub import {
my ($cls,$symspec,%options) = @_;
if($symspec) {
#We're being imported as user..
require 'Constant/Generate.pm';
$options{dualvar} = 1;
@_ = ('Constant::Generate', $symspec, %options);
goto &Constant::Generate::import;
} else {
goto &Exporter::import;
}
}
|