Noah wrote:
response inline below
John W. Krahn wrote:
Noah wrote:
I have a routine returning a perl reference and I am trying to figure
out how to properly use the hash tables in the main section of my
perl proggie.
--- from the main program
my $templateConfiguation =
&readConfigTemplate($templateConfigFilename,
$sortedTemplateConfigFilename);
.... and later on how do I properly use the hash
$templateConfiguation ....
} else {
print DIFF "d> $key" if !exists
($templateConfiguation{$templateType}{$key});
print MATCH "m> $key" if exists
($templateConfiguation{$templateType}{$key});
if ( exists $templateConfiguation->{ $templateType }{ $key } ) {
print MATCH "m> $key";
}
else {
print DIFF "d> $key";
}
okay so I get a peculiar error message that I am not sure how to correct:
Can't use string ("") as a HASH ref while "strict refs" in use at
./compare.configs.pl line 900.
--- line 900 to line 904 ---
if (exists $templateConfiguation->{$templateType}{$key}) {
print MATCH "m> $key";
} else {
print DIFF "d> $key";
}
That means that either $templateConfiguation or
$templateConfiguation->{$templateType} has a value of "" and not a hash
reference.
John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/