prion has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I have one script (on a BSD box) grabbing real time data off a web page on a 1 minute cycle that can't be delayed or lost, which is then saved out to a file. Another script then uses the updated data from that file in between updates. Is there an elegant way of telling the second script that the data is ready without actually opening the data file and checking if new data is present? I'm using flock() to prevent corruption of the data file. TIA Prion

Replies are listed 'Best First'.
Re: 2 scripts talking to each other
by KM (Priest) on May 01, 2001 at 21:51 UTC
    Take a look at the IPC::Shareable module. You can use it to create a variable in each script which can be shared. So, your first script can make it something the second will recognize as having new data in your text file.

    Cheers,
    KM

      Thanks, that got me going in the right direction.
Re: 2 scripts talking to each other
by how do i know if the string is regular expression (Initiate) on May 01, 2001 at 21:59 UTC
    You could have the grabbing script (script1) call the execute the the second script (script2).

    Just have script1 do a exec() calling script2 when it's done with the file.

    script1 would know best.

    - FrankG

      Thanks, I'll look into that.