in reply to Logging to web page with Mojolicious and strict
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Logging to web page with Mojolicious and strict
by TieUpYourCamel (Scribe) on Sep 12, 2019 at 15:37 UTC | |
by hippo (Archbishop) on Sep 12, 2019 at 15:56 UTC | |
by Anonymous Monk on Sep 12, 2019 at 19:38 UTC | |
by TieUpYourCamel (Scribe) on Sep 13, 2019 at 19:52 UTC |