in reply to Pre-evaluate string parameter

You might just want to validate $dirname.