He he, v Perlu mi tohle funguje bez problémů:
#!/usr/bin/perl use strict;
use warnings; my $spam = 10; sub fce_1 { print($spam, "\n"); } sub fce_2 { my $spam = 1; print($spam, "\n"); } sub fce_3 { print($spam, "\n"); my $spam = 1; print($spam, "\n"); } # my $spam = 10; ## Musí být deklarováno před suby. fce_1(); ## 10 fce_2(); ## 1 fce_3(); ## 10, 1 print($spam, "\n"); ## 10