in reply to string combinations

I'm going to make a zen answer to this one: why do you want to do this? My guess is that you're using some user input to make unique file names. I'd instead recommend that you use a sequential numbering system (have a file that contains a single number, then increment-- you'll have to do file locking, but there'll be a good learning opportunity there) and use a database or DBM file to track the username/whatever text they entered. That way you get to bypass the tainting problems, and make sure that people can't overwrite other people. Of course, depends on your application.

As for precisely what's going on in your script, the only likely explanation I can think of is that you're using single quotes. Or, try surrounding your scalar variable with braces: "dir/${computer}.txt".

Good luck.