Help me with this script

I have 2 simple scripts put on system scripts:

Name: script1

:global NUM 100

Name: script2

:global NUM ($NUM+1)

On the ROS v2.9.51, when I run script1 then open terminal:

:put $NUM
100

I run script2 and in the same terminal:

:put $NUM
101

The script is running well as I expect it.

But when I run those scripts on ROS v3.11, the strange happens:
I run script1 then open terminal:

:put $NUM
100

I run script2 and in the same terminal:

:put $NUM
1

That’s not I expect it.

On the ROS v3.11 when I declare global variable at the terminal:

:global STRG "This is a tes"

Then make a script3 on system scripts:

:log info $STRG

I run script3 then watch the system log, nothing happen there, it should be a line contains “This is a test”. Apparently script 3 can not see $STRG variable which is already defined global at the terminal.

Somebody help me please! I am considering downgrade ROS 3.11 to stable version 2.9.51 if the problem still can’t be solved.

Thanks in advance.

Script1

:global NUM 100;

Script2

:global NUM;
:set NUM ($NUM+1);
:put $NUM;