Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Using SV as key in hash

by liz (Monsignor)
on Jul 16, 2006 at 22:53 UTC ( #561609=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #include "EXTERN.h"
    #include "perl.h"
    ...
            hv_store( hv, SvPV( key, length ), length , val, 0 );
            HE *he = hv_fetch_ent( hv, key, 0, 0 );
            HeSVKEY_set( he, key );
    
  2. or download this
    my %hash;
    my $foo = 'foo';
    Data::Reuse::key_as_sv( %hash, $foo, $foo );
    print STDERR "found ".(keys %hash)." keys:\n";
    print STDERR " $_: $hash{$_}\n" foreach keys %hash;
    
  3. or download this
    found 1 keys:
     foo: 
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://561609]
Approved by Herkum
Front-paged by planetscape
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2015-07-04 07:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (58 votes), past polls