Using $$ to get the value of the reference
$variable1 = 5; $variablename = "variable1"; print "$$variablename\n"; print "$variablename\n";