in reply to qq function with variables

You need to tell perl where the variable name stops and where the rest of the text begins, using curlies. Without such a distinction in the example below, "$var12" could mean either $var12 or the value given by join( '', $var1, '2' ).

use strict; use warnings; my $var1 = 'one'; my $var12 = 'twelve'; print "$var12\n"; # prints 'twelve' print "${var1}2\n"; # prints 'one2'

This is discussed in perldata, "Scalar value constructors".