in reply to Weird things...

What kind of variable is $name? If it's a lexical (my) variable, it won't be visible in the included file. You could make it a local, or you could eval the contents of the file:

open FH, 'included.pl'; my $text; { local $/ = undef; $text = <FH>; } close FH; my $name = 'turd'; eval $text; die "error in included file: $@" if $@;