in reply to Re^2: Why is this string only PARTIALLY interpolated?
in thread Why is this string only PARTIALLY interpolated?

But what should happen if
$x = '$x';
?

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^4: Why is this string only PARTIALLY interpolated?
by tybalt89 (Monsignor) on Aug 01, 2023 at 16:22 UTC

    Handles $x = '$x'; but ?

    #!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11153644 use warnings; my $cat = { dog => '$cat->{squirrel}', squirrel => 'fred' }; my $x='$cat->{dog}/mouse'; { my %loop; until( $loop{ my $new = eval qq("$x") }++ ) { $x = $new } } print "$x\n";
Re^4: Why is this string only PARTIALLY interpolated?
by misterperl (Friar) on Aug 04, 2023 at 12:50 UTC
    Sadly, this horse has died.