Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: non-scalar hash key

by wol (Hermit)
on Jun 17, 2009 at 11:13 UTC ( #772337=note: print w/replies, xml ) Need Help??


in reply to Re^2: non-scalar hash key
in thread non-scalar hash key

Maybe the values in your hash could include the predicates in the original un-stringified format. That way you can have strings as keys, but lists still available when you need them later on in your program.

So your data structure might look like:

%allData = ( "1 2 3" => { location => "behind the sofa", predicates => [1, 2, 3], }, # More tokens here... );

--
use JAPH;
print JAPH::asString();

Replies are listed 'Best First'.
Re^4: non-scalar hash key
by kdejonghe (Novice) on Jun 17, 2009 at 11:33 UTC
    I'm afraid I do not have the luxury of adding another element to the hash values. We're dealing with a massive amount of data.
      I'm not suggesting that you add more data to your input files, if that's what you thought I meant.

      I'm suggesting that you extend the way the data is held in perl hashes/arrays/etc in memory when your program is running. And if you're not permitted to change how your program represents its data internally, then I'm not sure there's anything that anyone can do for you :-)

      --
      use JAPH;
      print JAPH::asString();

        I meant that I do not have the luxury of adding more information to the hash because I'm already running out of memory for some texts.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://772337]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2017-11-19 13:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (281 votes). Check out past polls.

    Notices?