in reply to variable declaration

Your code does not compile, and does not make sense. (Your communication also leaves a lot to the imagination.)

Try this code instead:

use strict; use warnings; my ($i , $j); $i = 1; $j = $i - 1; sub bca{ $i = $i+1; $j = $j+1; } print "Before SUB call \$i=$i\n"; bca(); print "After SUB call \$i=$i\n";

            "XML is like violence: if it doesn't solve your problem, use more."