use “perl -w”!

I thought "use strict" is enough and didn't try to run an application with the "-w" flag. (Don't blame me, it was under Windows.) As result, I played ping-pong with an user trying to identify an error instead of preventing the error.

Here is a minimal test case:

use strict;


sub test {
  my $param = shift;
  my $local;
  sub print_local {
    print "local = $local\n";
  $local = $param;

I expected to get:

local = 3
local = 4
local = 5

Actually I got:

local = 3
local = 3
local = 3

It's very counter-intuitive. If I used "-w", I'd get the warning:

Variable "$local" will not stay shared at line 11.