Is it possible to interpolate the contents of a variable into an escape sequence?
Something like
I have tried:
and none work the way I expected (that is not at all).
Is there a way to do this in perl?
Something like
Code:
# print LINEFEED, FORMFEED, and CARRIAGE RETURN
print "\c$_" foreach ('J', 'L', 'M');
I have tried:
Code:
my $x = "L";
print "\c$x";
my $x = "L";
print eval "\c$x";
my $x = '\c';
my $y = 'L';
print "$x$y";
my $x = '\c';
my $y = 'L';
print eval "$x$y";
my $x = '\c';
my $y = 'L';
my $z = $x$y;
$z =~ s/(\$\w+)/$1/eeg; # from perl faq4
print $z;
Is there a way to do this in perl?