The "Unrecognized escape \d passed through." message is there to stop people who don't remember that the right hand half of a s/.../.../g expression is a string, not a regex.
Here's one workaround:
my $string = qq(ITEM-####); # don't use qw() here unless you want a li
+st, BTW
$string =~ s/#/'\d'/eg;