[CentOS] Source keychain credentials in Perl?

Wed Mar 5 17:00:13 UTC 2008
Sean Carolan <scarolan at gmail.com>

>  system("source ~/.keychain/hostname-sh; cmd");
>
>  Is this what you're looking for?

Yes, this works.  Is there a way to only source the file once?  There
are a bit over a dozen scp and ssh commands in the script.
Unfortunately this is not my script, otherwise I'd have just done this
all in bash.