The App doesn't seem to load/call the JS script so as to register or install the service worker on the client's browser. How can I call a JS script to execute on Perl? Thanks.
This sounds as if your Javascript is not loaded from the HTML page. This is not a Perl problem.
To go forward with this, can you please reduce your code to say 20 lines that reproduce the problem? Maybe then we can understand better where your problem lies.