$ perl -wMstrict -le 'my $fn="x"; print "$fn.y"' x.y $ perl -wMstrict -le 'my $fn="x"; print "$fn_y"' Global symbol "$fn_y" requires explicit package name (did you forget to declare "my $fn_y"?) at -e line 1. Execution of -e aborted due to compilation errors. $ perl -w -le 'my $fn="x"; print "$fn_y"' Name "main::fn_y" used only once: possible typo at -e line 1. Use of uninitialized value $fn_y in string at -e line 1. $ perl -wMstrict -le 'my $fn="x"; print "${fn}_y"' x_y