To embed a variable within a regex.
Sample:

m/(Inventory_${file}_\w+.txt)/

$file being the variable.