1914
|
0 |
0 |
$__signature ||= sub {
my(%tmp, $tmp);
Hydrogen::croak("Wrong number of parameters in signature for %s: got %d, %s", "substr", scalar @_, "expected exactly 2 parameters") unless @_ >= 2 and @_ <= 4;
Hydrogen::croak("Type check failed in signature for substr: %s should be %s", "\$_[0]", "Str") unless do {
if (defined $_[0]) {
ref \(my $val = $_[0]) eq "SCALAR" unless ref \$_[0] eq "SCALAR";
}
};
Hydrogen::croak("Type check failed in signature for substr: %s should be %s", "\$_[1]", "Int") unless do {
my $tmp = $_[1];
$tmp =~ /\A-?[0-9]+\z/ if defined $tmp and not ref $tmp
};
return @_ unless $#_ >= 2;
Hydrogen::croak("Type check failed in signature for substr: %s should be %s", "\$_[2]", "Optional[Int]") unless do {
my $tmp = $_[2];
$tmp =~ /\A-?[0-9]+\z/ if defined $tmp and not ref $tmp
};
return @_ unless $#_ >= 3;
Hydrogen::croak("Type check failed in signature for substr: %s should be %s", "\$_[3]", "Optional[Str]") unless do {
if (defined $_[3]) {
ref \(my $val = $_[3]) eq "SCALAR" unless ref \$_[3] eq "SCALAR";
}
};
@_;
}
|