Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: How to pass hash site variables into sql connection using perl?

by finddata (Sexton)
on Mar 30, 2017 at 06:03 UTC ( [id://1186448]=note: print w/replies, xml ) Need Help??


in reply to Re: How to pass hash site variables into sql connection using perl?
in thread How to pass hash site variables into sql connection using perl?

I have few doubts: 1.Why you can given different database names like (db1,db2,db3).My database name should be a_$site1_current.Only the $site1 should be changed as per hash.

2,In the above code i had not fount any words which matches as like a_site1_current.
  • Comment on Re^2: How to pass hash site variables into sql connection using perl?

Replies are listed 'Best First'.
Re^3: How to pass hash site variables into sql connection using perl?
by huck (Prior) on Mar 30, 2017 at 06:25 UTC

    I have few doubts:

    what you have is little concern about doing your own work

    1.Why you can given different database names like (db1,db2,db3).

    because it is an generic example, that someone with any ability at all to think for themselves should be able to modify by themselves to suit their needs

    My database name should be a_$site1_current.Only the $site1 should be changed as per hash.

    A normal person should be able to fix the example themselves

    2,In the above code i had not fount any words which matches as like a_site1_current.

    Well what could you change to fix that? Can you not even think for yourself that much? Or do we need to write all your code for you? Are you going to pay us to do that? You need to tell your boss that you are not skilled enough to do your own work.

    site1 => { host => 'dam.sd.aog.com', db =>'a_site1_current', user =>'ad', pw= >'123' },

    ps: i dont see 36 lines in any here script so far, so of course you havent shown us what you have actually tried, and if this is actually a cgi program you wont have a lot of luck with GetOptions, you will need something like use CGI; my $site=$q->param('site'); instead.

Re^3: How to pass hash site variables into sql connection using perl?
by poj (Abbot) on Mar 30, 2017 at 06:21 UTC

    It was an example. You need to fill in your details like this

    my %site_map = ( site1 => { host => 'dam.sd.aog.com', db => 'a_site1_current', user=>'ad', pw=>'123' }, site2 => { host => 'dam.sd.aog.com', db => 'a_site2_current', user=>'ad', pw=>'123' }, site3 => { host => 'dam.sd.aog.com', db => 'a_site3_current', user=>'ad', pw=>'123' }, );

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-26 00:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found