Created
January 8, 2020 16:14
-
-
Save atoomic/98ee3a7af8e26989fb6bae6085c8e3ed to your computer and use it in GitHub Desktop.
Revisions
-
atoomic created this gist
Jan 8, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ #!perl use Test::More; my %storage; use constant SAMPLE_CONSTANT => defined eval { $storage{cache} = get_string('abcd') }; sub get_string { my ( $str ) = @_; return ":$str:"; } is SAMPLE_CONSTANT, 1, "constant is set to true"; is $storage{cache}, ':abcd:', "cache is set at compile time"; done_testing;