in reply to Memory has been increasing, unable to release memory.

AccountID handles errors by recursing, so you might just be building up a massive call stack. You should write your code with use warnings; like Eily suggests, so you would get a message about that. Try putting a debugging print in there to see if it's fetching the same account over and over again.
sub AccountID{ my $accountId=shift; print "Fetching account $accountId\n";
If it turns out that's what is happening, you need to find a better way to handle failures. Don't just keep retrying them over and over again forever!

Replies are listed 'Best First'.
Re^2: Memory has been increasing, unable to release memory.
by Perl_Love (Acolyte) on Mar 27, 2017 at 15:50 UTC
    Well, thank you. I'll try it when I'm at work.