in reply to sorting a hash that's in another file

Hi alienhuman - I just saw your message saying that you ARE dealing with a package.

Well - that should make life a lot easier - in your code, you simply use the package, and import the hash you need. If it is not explicitly exported, I believe you can still get at it using syntax like:

use ExistingPackage; my %copy_of_Hash = ExistingPackage::%some_hash;
I'm a fairly new monk myself, so I'm not that sure of the syntax.

Replies are listed 'Best First'.
Re: Re: sorting a hash that's in another file
by alienhuman (Pilgrim) on Aug 01, 2003 at 18:02 UTC

    NW

    Thanks for the help. The syntax that worked for me was:

    my %copy_of_Hash = %ExistingPackage::some_hash;

    Though you have to be sure that the %ExistingPackage::some_hash variable is not declared with the "my" operator in the module, or it's not accessible--even if it's in the main subroutine (as I found to my dismay and confusion).

    Cheers,

    AH