$SIG{__WARN__} = sub { my @loc = caller(1); print STDOUT "Warning generated at line $loc[2] in $loc[1]:\n", @_, "\n"; return 1; };