In addition to jasonk's very apt observation, I'd also wonder about this line:
# Retrieve answerset. while($odbc_session->FetchRow()) { # Stores the hash variable. eval $odbc_session->Data(); }
(Maybe it's just because I've never used odbc stuff -- but it looks like you're telling perl to execute something as code when it comes from a database. I'd be worried about that.)

Also, maybe this is just a nit-pick, but I'd change this:

while($odbc_session->FetchRow()) { # Stores the hash variable. my %pmsr = $odbc_session->DataHash(); ## push @pmsr, \%pmsr; # Pushes each value in the DWH_PrfMsr column i +nto the @pmsr. push @pmsr, {%pmsr}; # Pushes an anon.hash-ref copy of %pmsr onto + @pmsr. }
(Of course, it's not clear to me why you're doing this anyway -- maybe you really should be doing something completely different in the first place.)

As for nit-picks that have nothing to do with your question, there's probably a lot in the "Datetime" sub that could be done better; e.g. this:

my @datetime = ((localtime)[0,1,2,3,4,5]); foreach(@datetime) { if($count == 4) { $_ += 1 } elsif($count == 5) { $_ += 1900 } if(length $_ == 1) { $_ = "0$_"; } $count++; } my($sec,$min,$hour,$day,$month,$year) = @datetime;
could just be this:
my($sec,$min,$hour,$day,$month,$year) = map {sprintf("%02d",$_)} (loca +ltime)[0..5]; $month++; $year += 1900;
But there are probably a lot of other simplifications possible here -- including how this function is being used in the main part of the code (what you have is rather ugly and confusing).

BTW, it would be nice if your indentation style were consistent (and more conventional -- cf. perldoc perlstyle).

Oh, and did you notice that you have two different exit statements? And that the line to "Close ODBC session" comes after the first "exit" (hence is never reached)?


In reply to Re: out of memory! by graff
in thread out of memory! by as :)

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.