my $r = 300; my $g = 'g' . $r; print "$g\n"; #would be 'g300', that's ok $r = 500; print "$g\n"; #would be 'g300', but wanted 'g500'