The danger with this approach is it is up to the developer to ensure that the interpolated string is a valid SQL command. This is particularly dangerous when the valid you wish to store contains single quotes since it the escape mechanism is Database-dependent. It is far simpler to use DBI and the '?' (question mark) syntax to specify variable substitution at execution time. This method will take care of escaping any required data for you.?
my $path = '/path/to/this';
my $sql = 'INSERT INTO table SET ( path ) VALUES ( ? )';
my $STH = $DBH->prepare($sql);
$STH->execute($path);