CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
working on 2 servers

 



sanyukta
Novice

Feb 24, 2004, 2:16 AM

Post #1 of 9 (1073 views)
working on 2 servers Can't Post

Can I run a part of script say first 5 lines on one server and the remaining lines on another server. If yes please let me know how.

Thanks.


davorg
Thaumaturge / Moderator

Feb 24, 2004, 1:03 PM

Post #2 of 9 (1072 views)
Re: [sanyukta] working on 2 servers [In reply to] Can't Post

No.

But if you explain what you're trying to achieve, we might be able to suggest an alternative approach.

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks


sanyukta
Novice

Feb 24, 2004, 7:06 PM

Post #3 of 9 (1068 views)
Re: [davorg] working on 2 servers [In reply to] Can't Post

Hi Dave,

Actually I want to run a script on one server whereby in between it will rsh to some other server and get the data from tables installed on the other table. By using this data I can proceed with the script on my first server. Is there a way out for it?

Thanks,
Sanyukta.


davorg
Thaumaturge / Moderator

Feb 25, 2004, 12:46 AM

Post #4 of 9 (1066 views)
Re: [sanyukta] working on 2 servers [In reply to] Can't Post

What do you mean by

Quote
get the data from tables installed on the other table

Is this a database running on another server? Can't you just connect to the database remotely?

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks


sanyukta
Novice

Feb 25, 2004, 4:50 AM

Post #5 of 9 (1064 views)
Re: [davorg] working on 2 servers [In reply to] Can't Post

I am sorry it was a typo mistake. It means get the data from tables installed on other server. I cannot connect to the database remotely.Is there some other way out?

Thanks.


davorg
Thaumaturge / Moderator

Feb 25, 2004, 6:19 AM

Post #6 of 9 (1063 views)
Re: [sanyukta] working on 2 servers [In reply to] Can't Post

Why can't you connect to the database remotely? What type of database is it? Most databases allow remote connections? This would be the easiest option by far.

If that's really not an option, then why not write a CGI program on the database server which runs the query and returns the result. You could then access that program from the first server.

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks


sanyukta
Novice

Feb 25, 2004, 7:28 PM

Post #7 of 9 (1059 views)
Re: [davorg] working on 2 servers [In reply to] Can't Post

Thanks Dave!

I am using MySQL and will do the needful as told by you.


davorg
Thaumaturge / Moderator

Feb 25, 2004, 11:20 PM

Post #8 of 9 (1058 views)
Re: [sanyukta] working on 2 servers [In reply to] Can't Post

MySQL does support remote connections. From Perl you would just do:

Code
use DBI; 

my $dbh = DBI->connect('dbi:mysql:host=your_host',
'user', 'pass')
or die;

And there's a bit of configuration that you'll need to do one the MySQL server.

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks


sanyukta
Novice

Feb 26, 2004, 1:26 AM

Post #9 of 9 (1055 views)
Re: [davorg] working on 2 servers [In reply to] Can't Post

Thanks Dave!!! Sly

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives