in reply to variable value substitution

Do you need to rename the file too? If so, in addition to what toolic showed
rename($filename, $new_filename)
Just changing the string, won't actually change the name of the .dat file on the disk.

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh