Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: how to name an anonymous reference (dictionary/hash)

by beech (Parson)
on Dec 18, 2017 at 03:36 UTC ( #1205768=note: print w/replies, xml ) Need Help??


in reply to how to name an anonymous reference

Perhaps there is a different way to achieve what I am trying to do?

Hi,

Maybe you can use a dictionary of types?

my %type; $type{ENUM} = 9; # :O ?? ;) $type{ULONG} = 23; $type{IdKind} = [ $type{ULONG}, "value", undef ]; $type{AutoIdKind} = [ $type{ENUM}, "AutoidKind", [ "SEQUENTIAL", "HASH +" ]]; my @annotations = ( [ id => $type{IdKind}, ], [ autoid => $type{AutoIdKind}, [ $type{AutoIdKind}, value => 'HASH' ] +], ); dd \%type, \@annotations; __END__

???

AddAnnotation( autoid => Type('AutoIdKind'), [ Type('AutoIdKind'), val +ue => 'HASH' ] );

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1205768]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2020-01-24 01:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?