in reply to declare string with addition of two variables

You can also make concatenation implicit by getting the sum to evaluate inside interpolating quotes:

my $x = "Expected value is ${\($y + 2)}";
Some people hate that, but I think it adds flavor,

After Compline,
Zaxo

Replies are listed 'Best First'.
Re^2: declare string with addition of two variables
by Fletch (Bishop) on Sep 14, 2006 at 12:25 UTC

    If you're going to do that at least use the slightly more symmetrical @{[ $y + 2 ]}.

    Come on people! Aesthetics! We want eye-pleasing line noise.

    :)

Re^2: declare string with addition of two variables
by phemal (Sexton) on Sep 14, 2006 at 05:41 UTC
    that thing seems to be working. Thanks for the reply.