in reply to Re: Re: Re: Prototype Failing?
in thread Prototype Failing?

Actually, the call to $result= function(@some_args); is not a "method call" even if the first item in the array will subsequently be treated as an object. This is a regular function call, and will use normal sub lookup rules. It is semantically different from writing $some_args[0]->function(@some_args[1..$#some_args]); which will use the virtual calling mechanism and blessings to figure out which package's function to call first (and meanwhile ignore any prototypes).

The real answer here is: use strict; use warnings; It will tell you that the prototype is ignored and why!

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Prototype Failing?
by BrowserUk (Patriarch) on Jan 27, 2003 at 07:48 UTC

    True, but your looking in the wrong place. This line from the OP

    $chk->selftest(qw(This Is a Test of the emergency broadcast system!));

    is a method call. It's from this call that the sequence of events that lead to the error reported

    Not an ARRAY reference at OO.pm line 264.

    and is the starting point for the sequence of events that I outlined, that explains the error message.


    Examine what is said, not who speaks.

    The 7th Rule of perl club is -- pearl clubs are easily damaged. Use a diamond club instead.

Re: Re: Re: Re: Re: Prototype Failing?
by Flame (Deacon) on Jan 27, 2003 at 22:08 UTC
    Actually, I had both strict and warnings active and recieved no message.



    My code doesn't have bugs, it just develops random features.

    Flame ~ Lead Programmer: GMS (DOWN) | GMS (DOWN)