sub pp_const {
my $self = shift;
my($op, $cx) = @_;
+ if ($op->private & OPpCONST_ARYBASE) {
+ return '$[';
+ }
# if ($op->private & OPpCONST_BARE) { # trouble with `=>' autoquoting
# return $self->const_sv($op)->PV;
# }
my $sv = $self->const_sv($op);
# return const($sv);
- if ($op->private & OPpCONST_ARYBASE) {
- return '$[';
- }
my $c = const $sv;
return $c =~ /^-\d/ ? $self->maybe_parens($c, $cx, 21) : $c;
}
my $op = shift;
my $type = $op->name;
if ($type eq "const") {
- return uninterp(escape_str(unback($self->const_sv($op)->PV)));
+ if ($op->private & OPpCONST_ARYBASE) {
+ return '$[';
+ }
+ return uninterp(escape_str(unback(const($self->const_sv($op)))));
} elsif ($type eq "concat") {
my $first = $self->dq($op->first);
my $last = $self->dq($op->last);