Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Integrating codebases: namespace pollution, passing objects, and more

by Anonymous Monk
on Feb 27, 2017 at 18:04 UTC ( [id://1182983]=note: print w/replies, xml ) Need Help??


in reply to Integrating codebases: namespace pollution, passing objects, and more

I would rewrite the CGI code. Should take less time than trying to make your existing code work, which will at best be no better than a leaky abstraction. So rewrite the code now and be thankful for it tomorrow.

Replies are listed 'Best First'.
Re^2: Integrating codebases: namespace pollution, passing objects, and more
by Anonymous Monk on Feb 27, 2017 at 18:52 UTC
    The codebase is huge -- 350+ modules, written in a mixture of procedural and OO styles, no separation of concerns (e.g. html and js mixed in with perl), no tests, etc. Rewriting it would be optimal but not practical for my current circumstances, which is why I would like to "sandbox" the old code somehow so I can use it without too much modification.

      One possible way to sandbox the CGI code is to run it in it's own process or thread. Depending on that code's behavior, you might not have to destroy the thread/process after each request.

      Another possibility is to let the webserver run it and have your Dancer app either send a redirect to the user's webbrowser, or send it's own HTTP request to the webserver. Obviously, if you go the redirect route, the CGI app wil have to be modified to include a redirect back to the Dancer app in it's response to the webbrowser's request.

      So just sandbox a bunch of old crap and hope it holds up, again, for another 10 years ... good luck with that.
        Thanks -- it's creating the sandbox to prevent namespace pollution, etc., that this question is about.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1182983]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-03-29 11:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found