Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

subrouting prototype

Status
Not open for further replies.

drkestrel

MIS
Sep 25, 2000
439
GB
I get the following error when trying to execute my script
Code:
main::logging() called too early to check prototype at mfileparser.pl line 58

My code is of the following structure
Code:
##Some code
if (someCondition>1000)
{
   logging("log this condition");
}
##Some other codes

sub logging($)
{
  #Do something with $_[0]
}

What's wrong?
 
Does the error happen if you move the subroutine declaration to some point before the code calling it? This shouldn't matter, and i found no references to having to do so in the camel book or perl documentation, but that's what it looks like it's saying. "If you think you're too small to make a difference, try spending a night in a closed tent with a mosquito."
 
I put the subroutine declaration first(i.e. just the line declarating the method signature) before using it, and it works :)!
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top