in reply to Error with CPAN module XML-BMEcat
Update: But if I set $self to a string (instead of a reference to the array) && I turn off strictures, then the program runs to completion and foo() returns 0.use warnings; use strict; my @k = (1,2,3); my $self = \@k; # an ARRAY reference my $ret = foo($self, 'key'); print "$ret\n"; sub foo { my ($self, $key) = @_; (exists $self->{$key}) ? return $self->{$key} : return 0; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Error with CPAN module XML-BMEcat
by derion (Sexton) on Aug 10, 2017 at 15:21 UTC | |
by Anonymous Monk on Aug 11, 2017 at 00:17 UTC | |
by derion (Sexton) on Aug 11, 2017 at 12:05 UTC | |
by Anonymous Monk on Aug 11, 2017 at 01:19 UTC |