This looks remarkably similar to a problem I fixed in legacy code at work in the last week or two.
The issue occurs somewhere in the code behind DBI->connect($dsn, ... (which I didn't delve into to any great depth). The problem relates to the backslashes in the MSWin path which, somewhere in the DBI code, get interpreted as escapes.
In your first script, you use a literal for the path; in your second script, you don't. Consider:
$ cat > fred $x = 'one_dir\two_dir'; $y = "one_dir\two_dir"; $ perl -MO=Deparse fred $x = 'one_dir\\two_dir'; $y = "one_dir\two_dir"; fred syntax OK
$x has the "\t" part escaped (i.e. "...\\t..."); but $y does not and is actually "one_dir<TAB>wo_dir".
The fix I implemented used quotemeta. I notice throughout this thread that you tried different versions of the DSN string; I suspect something like this might suffice for your needs:
my $dsn = "dbi:SQLite:\Q$path";
— Ken
In reply to Re: pp concatenate path
by kcott
in thread pp concatenate path
by IB2017
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |