I cannot get this to work to save my life...

I created a cron job to run every night and process autoship orders.
Here is a partial sample of my code:
my $_todayIs = Format_Date_For_Viewing(time(),"day_only"); my $sth = $dbh->prepare(qq{SELECT * FROM `autoship_orders` WHERE `day` + = ?}); $sth->execute($_todayIs); my $_cnt = 0; my $_suc = 0; my $_fai = 0; while(my $_sao = $sth->fetchrow_hashref()) { $_cnt++; my %_billingInfo = (); my $sth2 = $dbh->prepare(qq{SELECT * FROM `secured_data` WHERE `si +d` = ? AND `Id` = ?}); $sth2->execute($_sao->{sid},$_sao->{Id}); my $_sd = $sth2->fetchrow_hashref(); $sth2->finish(); $sth2 = $dbh->prepare(qq{SELECT * FROM `reg_members` WHERE `Id` = +?}); $sth2->execute($_sao->{Id}); my $_regmem = $sth2->fetchrow_hashref(); $sth2->finish(); # Get Secure Data my $_billing = $_sd->{p11}; $_billing = decryptdata($_billing,$_encryptionKey); $_billing = decrypt($_billing); # Bunch of other code.... decryption ........ my @_billingData = split(/;/, $_billing); ($_billingFname,$_billingLname) = split / /, $_billingData[0], 2; $_billingInfo{fname} = $_billingFname; $_billingInfo{lname} = $_billingLname; $_billingInfo{address} = $_billingData[1]; # other code setting some other hash keys in %_billingInfo my $_cardCharged = chargeCard(\%_billingInfo); # That is what I have passed # Here is my chargeCard sub (top of it anyways): sub chargeCard { %_billingInfo = shift;
Anyhow, I created code to debug it, like this:
my $_debug = 1; open(BUG,">>/home/path/to/file") if $_debug; seek(BUG, 0, 2) if $_debug; print BUG qq~Started debugging at line: ~ . __LINE__ . "\n" if $_debug +; if($_debug) { foreach my $key (keys (%_billingInfo)) { print BUG escapeHTML ($key) . " = " . escapeHTML ($_billin +gInfo{$key}) . "\n"; } }
Now in the while statement readin the database, where I create it, it does print all the keys in the text file, but where I pass it, there is nothing. I have passed it these ways, all to no avail:

my $_cardCharged = chargeCard($_billingInfo); sub chargeCard { %_billingInfo = shift; # AND my $_cardCharged = chargeCard(\$_billingInfo); sub chargeCard { %_billingInfo = shift; # AND my $_cardCharged = chargeCard(%_billingInfo); sub chargeCard { %_billingInfo = shift; # AND my $_cardCharged = chargeCard(\%_billingInfo); sub chargeCard { %_billingInfo = shift; # AND every other way I can think of...
I am getting so frustrated, I cannot fingure out what I'm doing wrong. I pass hash's all the time, but I cannot get this to work to save my life. I'd appreciate any help you can be.

Thank you very much Richard

In reply to passing hash to subroutine by ukndoit

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.