in reply to AJAX call to Perl script + return - error

Take a look at your web server's access.log and error.log - to see if the correct URL to your script is being called.

Perhaps the URL needs to be absolute, not relative, in your statement:

method: 'GET', url: `../cgi-bin/test-dbi.pl`,
Also - it would help if you posted the actual error you got.

        ...Disinformation is not as good as datinformation.               Don't document the program; program the document.