$self->{'ambient_warnings'} = undef; # Assume no lexical warnings
$self->{'ambient_hints'} = 0;
$self->{'ambient_hinthash'} = undef;
- $self->{'inlined_constants'} = $self->scan_for_constants;
$self->init();
while (my $arg = shift @_) {
if (class($sv) eq "SPECIAL") {
# sv_undef, sv_yes, sv_no
return ('undef', '1', $self->maybe_parens("!1", $cx, 21))[$$sv-1];
- } elsif (class($sv) eq "NULL") {
+ }
+ if (class($sv) eq "NULL") {
return 'undef';
- } elsif ($cx and my $const = $self->{'inlined_constants'}->{ 0 + $sv->object_2svref }) {
- return $const;
+ }
+ if ($cx) {
+ unless ($self->{'inlined_constants'}) {
+ $self->{'inlined_constants'} = $self->scan_for_constants;
+ }
+ my $const = $self->{'inlined_constants'}->{ 0 + $sv->object_2svref };
+ return $const if $const;
}
# convert a version object into the "v1.2.3" string in its V magic
if ($sv->FLAGS & SVs_RMG) {