in reply to Return hash from a com object. ?

G'day cdlvj,

Disclaimer: I can't help you with specifics of "perl dll created by perl Ctrl"; sounds like a MSWin thing (with which I'm unfamiliar).

In many functions, you'll only be interested in the hash's keys and values; the name of &readDirectory suggests it would fall into this category. In these cases, your best choice will probably be:

return { %rlist };

In other functions, particularly those that need to modify the hash in some way, a reference to the original hash may be important. In these cases, your best choice will probably be:

return \%rlist;

See also: perlreftut, perldsc and perlref.

— Ken