I have a subroutine called debug
I use in my code. It basically allows me to see what\'s going on, etc.
sub debug {
my $message = shift
If I am understanding correctly, you want to prototype and predeclare so that you can use the function (prototyped and braceless) within the same file. This is what the subs pragma is for.
For example, this code works correctly:
#!/usr/bin/env perl
use strict;
use warnings;
use subs qw/mysay/;
mysay "Yo";
mysay "Yo", "Joel";
sub mysay ($;$) {
my $message = shift;
my $speaker = shift;
if (defined $speaker) {
$message = "$speaker says: " . $message;
}
print $message, "\n";
}