I have the following regex:
my ($pkg) = ( $xmldirname =~ /$db(.*)^/ );
What it should do is: check if the xmldirname starts ($) with "db" and take the rest of the string into $pkg.
What it does is: "Global symbol $db requires explicit package name".
How do I do this? Using qr// didn't work, either.
Yes, ok, I see. $ is end, not start. I'm sorry....
It seems to me that you misused the anchor.
Use this:
You could also remove the terminal
$
: