in reply to hash key
Like other posts pointed out: You could create a string from the array (like join "\0", @array) and use this as key or maybe use a Tie package. But this all depends on what you really want to do.#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my @a = (1,2,3); my %h; $h{\@a} = "value"; my @b = @a; $h{\@b} = "other value"; print Dumper \%h; __END__ $VAR1 = { 'ARRAY(0x84df0e0)' => 'other value', 'ARRAY(0x847c540)' => 'value' };
|
|---|