You can't really compare PHP with a Perl script.

PHP is usually run via a webserver and more precise via a module of the webserver, which will re-use certains processes/threads.
And only when something is re-used it can use an already made connection (so a script that is run via CGI can't re-use a connection made the previous time the page was loaded), using two connections from inside the same script would be possible but that isn't the default behaviour (or atleast not for a normal Perl script).

If you would run perl via the apache module mod_perl and you have loaded Apache::DBI then the default would be to use the connect method of Apache::DBI which will try to use a previous created connection


In reply to Re^2: DBI / Mysql connections by Anonymous Monk
in thread DBI / Mysql connections by cyril

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.