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

hi,

I am using the perl module use GD::Graph::Map; for my work , however i meet a problem as this message

GD::Graph::Map::level_angle() called too early to check prototype at /usr/local/lib/perl5/site_perl/5.6.1/GD/Graph/Map.pm line 366. GD::Graph::Map::level_angle() called too early to check prototype at /usr/local/lib/perl5/site_perl/5.6.1/GD/Graph/Map.pm line 367.

Could you please tell me how to solve this problem? it is very urgent!!!!!!!!!111

thank you very much

jdporter - retitled from "Module MAP"

Replies are listed 'Best First'.
Re: Strange error in GD::Graph::Map
by Callum (Chaplain) on May 07, 2004 at 14:15 UTC
    You're calling a sub before it's defined.

    For example, doing::

    #!/tools/bin/perl -w greet('world'); sub greet ($) { print "Hello $_[0]!\n"; }
    gives:
    main::greet() called too early to check prototype at .//cte line 2. Hello world!
      thanks you very much for your reply, for a normal use, ususally the code for subroutine is at the last of script?
        You can put the subroutine definition just about anywhere. But if you're going to declare prototypes, that must happen before your first call to the sub.

        Just don't use prototypes. You really don't need them, really.


        Dave