in reply to Expression inside hash

qw() quotes "words" so your expression is not being evaluated. See perlop : Quote and Quote-like Operators for more info.

Try:

my %g_tun = ( "R1", 100*32+1, "R2", 1, "R3", 100*32+1 );
or:
my %g_tun = ( R1 => 100*32+1, R2 => 1, R3 => 100*32+1, );

Hope this helps!


The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^2: Expression inside hash
by Anonymous Monk on Apr 04, 2016 at 05:39 UTC

    Thanks.That worked