I was stuck on a tough problem at work a little while ago, and had a nice Perl moment in its resolution.

I'm cleaning up a buggy shopping cart app, and stripping out inconsistent use of hidden fields and cookies in the process, replacing it all with a hash of session data a la Apache::Session. The app uses MySQL and DBI, so of course I headed straight for CPAN to download Apache::Session::MySQL. That module seemed to have a problem with the old version of DBD::mysql installed, so I started looking at the upgrade list...

Unfortunately this site runs in a virtual server environment that makes some upgrades a challenge -- old version of Perl and various libraries, and fear on my part that I could break working sites if I made large changes. I had trouble with mismatched MySQL header files and libraries (don't ask me how my predecessor got DBD::mysql installed previously, but the old version works fine). I struggled with the issue for a few hours, and considered ripping out the session code and trying to get the cookies and hiddens to play well together.

Then the nice moment occurred; with one exception I've always used Apache::Session::MySQL, but there are several implementations. Sure enough, Apache::Session::DB_File installed just fine, and with a few code mutations everything worked as planned.

I made a mental note to not be so fixated in my approaches to problems; if a familiar module doesn't work (because of the environment or because of the nature of the problem) chances are there's still other solutions waiting for us on CPAN.


In reply to Familiar module vs. TMTOWTDI by TheoPetersen

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.