I am writing code for work and have run into an interesting issue. I have searched my go-to resources on the topic and have not found a clear answer.
When writing a sub function in a Perl module, is a semicolon required after the closing brace?
As in:
sub printFoo {
print "foo";
};
Is this somehow different than a sub function in a regular Perl script?
When I use the above function in a module without the semicolon I get an error referencing an "undefined subroutine."
I feel confident that in the past I have used similar pieces of code without the semicolon following the closing brace but now I am no longer positive.
A push in the right direction would be great!