-
Notifications
You must be signed in to change notification settings - Fork 582
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use do rather than require to load a mojo application
The return value of require is usually not a reasonable thing to rely on, aside from it being true. The first time requiring a file, it will return the value of the last statement in the file. The second time requiring a file, it will return a simple true value. Mojo was bypassing this problem by deleting the %INC entry for the file, forcing it to always be loaded again. But the new module_true core feature will cause require to always return a simple true value rather than the last statement in the file. This does not apply to do though. Switch to using do to be compatible with code using the new feature.
- Loading branch information
Showing
3 changed files
with
27 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use v5.38; | ||
use Mojolicious::Lite; | ||
|
||
app->config(script => $0); | ||
|
||
app->start; | ||
|
||
=head1 SYNOPSIS | ||
USAGE: myapp.pl daemon | ||
test | ||
123 | ||
=cut |