in reply to Re: How can we interpolate an expression??
in thread How can we interpolate an expression??

Yes.. I can use single quotes and '.' to concatenate the results just as we do in Java..
say 'Result is :' . $num * $multipler;

Replies are listed 'Best First'.
Re^3: How can we interpolate an expression??
by Anonymous Monk on Sep 20, 2012 at 18:10 UTC
    my $arrayref = [ 4200 / 100 ]; print "The answer is $arrayref \n";
    The answer is ARRAY(0x3f8a94)

    my $arrayref = [ 4200 / 100 ]; print "The answer is @$arrayref \n";
    The answer is 42

    my $arrayref = ; print "The answer is @[ 4200 / 100 ] \n";
    syntax error at - line 1, near "= ;" Execution of - aborted due to compilation errors.

    print "The answer is @{[ 4200 / 100 ]}\n";
    The answer is 42