lua, perl: fix compilation issues (from commit dcc07b4c)