my $p = "\"\$sym{'\$b'}/helloworld/test.dat\""; # my $p = 'qq[$sym{'$b'}/helloworld/test.dat]'; # alternative # my $p = '"$sym{\'$b\'}/helloworld/test.dat"'; # alternative # my $p = q["$sym{'$b'}/helloworld/test.dat"]; # alternative $sym{'$b'} = "my"; my $val = eval $p; print "p = $val\n";