use strict;
use warnings;
sub XX { 30 };
my $rnd = 3;
my $z = -XX * $rnd;
Give error: Can't use string ("3") as a symbol ref while "strict refs" in use
This does not help:
my $z = -XX * ($rnd);
I get next error:
Scalar found where operator expected at game4.pl line 7, near "* ($rnd"
(Missing operator before $rnd?)
syntax error at game4.pl line 7, near "* ($rnd"
Execution of game4.pl aborted due to compilation errors.
How to force EXPR instead of GLOB dereference?