Piecia aka dracorp
unread,Feb 25, 2015, 2:32:47 AM2/25/15You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Witam
Mam związany hash z klasą za pomocą tie. Wartości dla tego hasha to tablica dwuelementowa. Pytanie dlaczego dla wantarray* nigdy nie zwraca true dla postaci:
#v+
my @array = $hash{klucz};
#v-
Jedyny sposób żeby pobrać tablicę to:
#v+
tied(\%hash)->FETCH('klucz');
#v-
Na początku myślałem że to wina starego Perla, 5.8.8 ale na nowym jest to samo.
*)
#v+
sub FETCH {
my ( $self, $key ) = @_;
if ( exists $self->{$key} ){
if ( wantarray ){
return @{$self->{$key}};
}
else {
return $self->{$key}->[VALUE];
}
}
return;
}
#v-
--
Pozdrawiam Piotr
piecia aka dracorp