I am searching for efficient ways of communication across two Perl scripts. I have two scripts; Script 1 generates some data. I want my Script 2 to be able to access that information.
The easiest/dumbest way is to write the data generated by Script 1 as a file and read it later using Script 2. Is there any other way than this? Can I store the data in memory and make it available to Script 2 (of course with support from my Linux )? Meaning malloc some data by Script 1 and make Script 2 able to access it.
There is no guarantee that Script 2 will be run after Script 1. So there should be some way to free that memory using a watchdog timer.
Let me reveal some more context. I am running these scripts on a web-server using CGI-Perl. So at the click of a button Script 1 is run and it generates a html web-page. Now the user can add some inputs to to this generated web-page and click a button on this new page.Now Script 2 should be able to read the data on new web-page.I can post the data back to web-server again but a more efficient way is to keep a copy of generated page in server also and make it available to script 2. Now, I would like to avoid writing down the generated page as a file. I was thinking of storing it in memory
Let me reveal some more context. I am running these scripts on a web-server using CGI-Perl. So at the click of a button Script 1 is run and it generates a html web-page. Now the user can add some inputs to to this generated web-page and click a button on this new page.Now Script 2 should be able to read the data on new web-page.I can post the data back to web-server again but a more efficient way is to keep a copy of generated page in server also and make it available to script 2. Now, I would like to avoid writing down the generated page as a file. I was thinking of storing it in memory