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.


In reply to Re^3: How to pass hash site variables into sql connection using perl? by huck
in thread How to pass hash site variables into sql connection using perl? by finddata

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.