Professional Web Applications Themes

how would i handle this? - PERL Miscellaneous

hey, im building a full-fledged 32-bit assembler in perl (its really gonna be a perl script) and i have a problem with the hash table that will hold the mnemonic - opcode conversion info...this hash table is gonna be pretty big because its gonna have all the info along with the various forms of each instruction so instead of having to build the hash table everytime the script is run in a session, i would like to make it so that in a given session, the hash table gets constructed only the first time around and then stays in memory ...

  1. #1

    Default how would i handle this?

    hey,

    im building a full-fledged 32-bit assembler in perl (its really gonna be a perl
    script) and i have a problem with the hash table that will hold the mnemonic -
    opcode conversion info...this hash table is gonna be pretty big because its
    gonna have all the info along with the various forms of each instruction

    so instead of having to build the hash table everytime the script is run in a
    session, i would like to make it so that in a given session, the hash table
    gets constructed only the first time around and then stays in memory for later
    use in that session, because that hash table info doesnt change at all

    how would i go abt achieving this? any special modules needed?

    thanks


    --The Mosquito Scriptkiddiot.
    "Those who dance are often considered crazy by those who can't hear the music"
    The Guest

  2. #2

    Default Re: how would i handle this?

    On Sat, 18 Oct 2003, The Mosquito ScriptKiddiot wrote:
     


    use Storable;


    --
    xemoth

    sdf.lonestar.org
    Owen Guest

  3. #3

    Default Re: how would i handle this?

    Owen wrote: 
    >
    > use Storable;[/ref]

    Wouldn't the use of Storable mean that the hash would need to be built
    every time, i.e. just what OP is striving to avoid?

    Provided that it's a simple one-dimensional hash, my first thought is
    to store it in a DBM file and access the data via a tied hash.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl

    Gunnar Guest

  4. #4

    Default Re: how would i handle this?

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    comnospam (The Mosquito ScriptKiddiot) wrote in
    news:aol.com:
     

    What's a "session"?

    I think you have basically two choices: build the hash each time
    (preferably from a config file), or store the data into a database file and
    tie a hash to that db file.

    - --
    Eric
    $_ = reverse sort $ /. r , qw p ekca lre uJ reh
    ts p , map $ _. $ " , qw e p h tona e and print

    -----BEGIN PGP SIGNATURE-----
    Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

    iQA/AwUBP5KUpWPeouIeTNHoEQLZtwCgpLHKT7xZBOtfY/7vxrTpZ3pboAoAoNrD
    E05sae9aht0ODTjze3b+CoIC
    =+wy8
    -----END PGP SIGNATURE-----
    Eric Guest

  5. #5

    Default Re: how would i handle this?

    >What's a "session"?

    by session i mean everytime the user works on his program...writes the asm
    code, assembles+links,rewrites and so on until he/she gets tired and comes back
    another time
     

    i think this is what im gonna have to do..thanks


    --The Mosquito Scriptkiddiot.
    "Those who dance are often considered crazy by those who can't hear the music"
    The Guest

Similar Threads

  1. Tie::Handle::CSV Help...
    By onlineviewer in forum PERL Modules
    Replies: 5
    Last Post: July 24th, 10:09 PM
  2. When to use a Ptr vs a Handle?
    By Peter in forum Mac Programming
    Replies: 20
    Last Post: February 4th, 07:18 AM
  3. Handle name in MIAW?
    By AstrO in forum Macromedia Director Lingo
    Replies: 6
    Last Post: January 13th, 02:38 AM
  4. handle the IE.
    By Mr. x in forum Macromedia Flash
    Replies: 1
    Last Post: October 8th, 09:33 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139