Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: Absolute simplest way to keep a database variable persistent?

by natestraight (Novice)
on Oct 06, 2008 at 13:57 UTC ( [id://715573]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Absolute simplest way to keep a database variable persistent?
in thread Absolute simplest way to keep a database variable persistent?

Yeah, I thought about using a server to handle the issue. The problem with this method is that, ideally, my finished application (excel sheet + custom VBA functions + working Perl scripts) is going to be transferred to other users, who are not even able to be considered n00bs. I'm trying to keep the techie overhead and the requisite configuration to a minimum so that I can just bundle up the necessary Perl directories in a .zip and send them along with my spreadsheet.
  • Comment on Re^4: Absolute simplest way to keep a database variable persistent?

Replies are listed 'Best First'.
Re^5: Absolute simplest way to keep a database variable persistent?
by admiral_grinder (Pilgrim) on Oct 07, 2008 at 13:27 UTC
    Instead of using a webserver, have your Perl script fork off its own server (if one isn't running at the time). It can communicate on a socket. We have a CGI program that keeps an large XSLT in standby. Using IO::Socket:
    my $sock = new IO::Socket::INET ( LocalHost => $server, LocalPort => 9200, Proto => 'tcp', Listen => 2, ReuseAddr => 1, ); die "socket creation error: $!" unless $sock; while( my $client = $sock->accept() ) { binmode $client, ":utf8"; $client->autoflush(1); # Read data while( $client->recv( $in_buffer, $buffer_size ) ) { # Store data } # Process data # Return data $client->send( $output ); }
    Some things to consider to make it dummy proof is allow it to adjust what port is runs on at runtime, and to have the server exit after a while to avoid zombie processes.
      Sounds possible. Thanks for the sample code, too.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2025-12-16 15:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (96 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.