Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

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?

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2018-07-19 17:39 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (412 votes). Check out past polls.