>coffee wrote:
>[snip]
>> 1)
>> script one ::
>> send request to script two with something like ?grab=variable
>> 2)
>> script two ::
>> sees that they want the value of 'variable' and sends
>> it back to script one with something like ?variable=monkey
>> 3)
>> script one ::
>> parses that reply from script two and uses the data
>> $variable = $input_from_script_two{'variable'};
>> print "You are a $variable";
>>
>[snip]
>I'm not clear what your scripts have to do with LWP. You could easily
>implement this with Net::Socket or something if all you want is two
>scripts to communicate with each other over the network.
I'm willing to try anything! :-)They have to communicate over the
internet each on two different servers in two different cities.
>Can you be more specific as to what you are trying to accomplish?
Sure thing.
I have data stored in a mysql database.
I have a script that can access that database and set certain variables to
their appropriate values.
Instead of giving every script I want to use those variables all of that
code and more imortantly access to the database itself. I need to be able to
send it a request somehow for a specific variable, have it set that variable
form the database, and return it to the original requesting script.
Maybe LWP isn't what I need, I got the idea from looking over the paypal ipn
system and seeing their use of LWP for a similar idea.
If I was to write it out as I'd script it I would think it would be similar
to this obviously I'm going to do more than just pritn it out but I don't
want to :
#!/usr/bin/perl
$url = "http://domain.com/get_data_from_db.cgi";
#send request, how exaclty I don't know
$url?grab=first_name,last_name
# $url would get this request, set the data and send back key,value pairs
$result = ????
# $result would look like first_name=Joe&last_name=Mama
#parse $result into a hash or vars or whatever here
print "Hello $input{'first_name'} $input{'last_name'}";
Does that explain a little better what I need to do?
Thanks
Dan