Ok, this is the strangest thing. I've been staring at it for an hour,
and it has to be something monumentally stupid.
I have a function that is given a hash reference and it then just looks
up one of its elements in an anonymous hash that points to other
functions. Here's the function (I removed the part where it calls
another function - this is just demonstrating the strange behavior):
my $db_table = {
codeline => \&write_codeline,
compounddef => \&write_compound,
includes => \&write_includerelation,
initializer => \&write_initializer,
innerclass => \&write_innerclass,
param => \&write_param,
type => \&write_type,
};
sub writeToDatabase
{
my $this = shift;
print "[$this->{hashRef}->{tag}] \n";
return unless ( exists $db_table->{$this->{hashRef}->{tag}} );
print "We didn't return.\n";
}
Pretty straightforward? Here's a sample run of the program:
[location]
[includes]
[compounddef]
[includes]
[includes]
[includes]
[includes]
[includes]
[includes]
Notice that 'includes' and 'compounddef' are in that $db_table
reference? And they're clearly in the $this hash. So why isn't it
finding them in my $db_table hash?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
- Question about the Shell module Bruno Negrao
- Re: Question about a hash. Ben Siders
- Re: Question about a hash. Ben Siders
- Re: Question about a hash. John W. Krahn
- Re: Question about the Shell module Jenda Krynicky