I have a Perl file like this:
use strict;
f1();
sub f3()
{ f2(); }
sub f1()
{}
sub f2()
{}
In short, f1
is called before it is d
When you define a function in Perl you should not use parentheses. When you do so you get this error. This is wrong:
sub DoSomthing(){
#do what ever...
}
This is the way to go:
sub DoSomthing{
#do what ever...
}
no parentheses.
For more detailed explenation see Gabor Szabo's Perl Maven page on Subroutines and functions in Perl. https://perlmaven.com/subroutines-and-functions-in-perl