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

Re: [MacPerl-AnyPerl] choked test hash



On Tue, Jul 18, 2000 at 04:04:05PM +0900, Joel Rees wrote:
> 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".

The error I get is:

Can't locate object method "c" via package "choke"...

> from the code below:
> 
> my %hash = ( a alpha b beta c choke );

C<foo bar> is equivalent to C<bar->foo()>.

For example, you could do either of the following when using the CGI
module:

  $q = new CGI;
  $q = CGI->new();

You could also do:

  $q = CGI::new();

which is similar, but avoids the method lookup process.


So, C<a alpha b beta c choke> tries to call choke->c(), which doesn't
exist.  If choke->c() did exist, you would have gotten another error:

Bareword found where operator expected...


Ronald

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