Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Two subroutines that I wrote generate the warning:

"Ambiguous call resolved as CORE::open(), qualify as such or use &"

As far as I can tell these subroutines are in no way different from any other subroutines in the package. Does anyone know what this warning means? thanx.

Replies are listed 'Best First'.
Re: ambiguous call warning
by mpeppler (Vicar) on Mar 08, 2002 at 00:26 UTC
    It means that you have in the same package a subroutine called open(),so that when you call open(...) perl has to figure out if you want to call your local open() or perl's open().
    The message tells you that perl decided to call its own open() (i.e. CORE::open()) rather than the one in your package/module.

    Michael

Re: ambiguous call warning
by rjray (Chaplain) on Mar 08, 2002 at 01:14 UTC

    Another cause of this error could be an attempt to use the string "open" as a bareword-string in some context that the interpreter can't make a clean assumption about.

    For example, when writing quick and dirty code using the CGI module and forms, I sometimes get that warning for the keyword, "values". Several of the form widgets like listbox, etc., have a parameter called "-values" that can be mistaken for a - followed by values, and expecting a hash following that.

    You may have a similar situation in your code.

    --rjray

Re: ambiguous call warning
by shotgunefx (Parson) on Mar 08, 2002 at 00:13 UTC
    It would appear that it means exactly what it says. That it can't determine what sub to call. Hard to say more without seeing code.

    -Lee

    "To be civilized is to deny one's nature."
Re: ambiguous call warning
by Marza (Vicar) on Mar 08, 2002 at 00:24 UTC
    It's telling you that it can't find a sub you have called. Make sure you are loading the mod correctly. Check for a typo or just load the whole thing.