in reply to Re: How can we interpolate an expression??
in thread How can we interpolate an expression??
http://perldoc.perl.org/perlintro.html#Scalars
print "The square of $answer is ", $answer * $answer, "\n";
print takes a list :) this list can be of a single item. join takes a list and makes it a single string
print join '', "The square of $answer is ", $answer * $answer, "\n";
you can also use the join operator (concatenation)
print "The square of $answer is ". $answer * $answer. "\n";
If you insist on interpolation, see
|
|---|