Thanks for your suggestions. Unfortunately I get the same error. Here's a SSCCE. Hopefully this helps.
index.mojo:
#!/usr/bin/perl
use Mojolicious::Lite;
my $logLine;
require './bigFileFullOfSubs.pl';
require './subImWorkingOn.pl';
any '/' => sub {
my $c = shift;
$logLine = "";
subImWorkingOn();
$c->stash(logLine => $logLine);
$c->render(template => 'main');
};
app->start;
__DATA__
@@ main.html.ep
<!DOCTYPE html>
<html><head></head>
<body>
<pre>
<%= $logLine %>
</pre>
</body>
</html>
BigFileFullOfSubs.pl:
#!/usr/bin/perl -w
use strict;
use warnings;
sub Log { # Generates nice looking log comment with time.
my ($LogItem) = @_;
$LogItem =~ s/\n/ /g;
my $Time = "functionThatGetsTheTime()";
my $thisLog = "[ $Time ] :: $LogItem\n";
$logLine .= $thisLog;
}
return 1;
SubImWorkingOn.pl:
use warnings;
use strict;
sub subImWorkingOn {
Log("Interesting information for the user here.");
Log("Even more fascinating information for the user here!");
Log("Processing complete");
}
return 1;
Error message:
Global symbol "$logLine" requires explicit package name (did you forg
+et to declare "my $logLine"?) at ./bigFileFullOfSubs.pl line 11.
|