[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl-AnyPerl] choked test hash



Okay, this is a real newbie question, I'm sure. I was testing 
concatenation on hash elements with the code below, and getting confused 
with qq and qw, and then I get the error 

     # Can't locate object method "chz" via package "choke".

from the code below:

my %hash = ( a alpha b beta c choke );

if ( exists $hash{ "a" } )
{	$hash{ "a" } .= "," . "more";
}
else
{	$hash{ "a" } = "less";
}

foreach $i ( keys %hash )
{	print "The element at $i is $hash{ $i }\n";
}
What ws it trying to tell me? I "fixed" it as soon as I realized I had 
left off the qw, but I would like to know why the last element seems to 
try to become a method in a package.


rees_joel@fujicomp.co.jp
http://www.fujicomp.co.jp
http://www.udit.gr.jp


==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-anyperl-request@macperl.org