Probably all you need is to declare it with my at the outermost scope of your code.
#!/usr/bin/env perl use strict; use warnings; my $logline; foo (); sub foo { $logline = 'Now we have called foo'; bar (); } sub bar { Log (); } sub Log { print "Logging: $logline\n"; }
If this does not work for you for some reason, an SSCCE would help to pin down the problem.
In reply to Re: Logging to web page with Mojolicious and strict
by hippo
in thread Logging to web page with Mojolicious and strict
by TieUpYourCamel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |