You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following file hello_world_constants.pl should compile without any errors:
#!/usr/bin/env perl
# [[[ HEADER ]]]
use RPerl;
use strict;
use warnings;
our $VERSION = 0.001_000;
# [[[ CRITICS ]]]
## no critic qw(ProhibitUselessNoCritic ProhibitMagicNumbers RequireCheckedSyscalls) # USER DEFAULT 1: allow numeric values & print operator
## no critic qw(ProhibitConstantPragma ProhibitMagicNumbers) # USER DEFAULT 3: allow constants
# [[[ CONSTANTS ]]]
use constant PIE => my string $TYPED_PIE = 'pecan';
# [[[ OPERATIONS ]]]
print PIE() . "\n";
print 'Hello, World!', "\n";
However, we see there are issues when attempting to compile a constant such as PIE() inside a .pl file:
someuser@somemachine:/tmp/rperl_tmp$ rperl -v
This is RPerl version 5.002_000, Long Date 20191128, Star Date 2019.332, Codename Skylab 2
v5.002_000 using RPerl's underscore-is-comma numbering scheme
v5.002000 using CPAN's underscore-is-beta numbering scheme
...
someuser@somemachine:/tmp/rperl_tmp$ rperl hello_world_constants.pl
[[[ BEGIN 'use Inline' STAGE for 'RPerl/HelperFunctions.cpp' ]]]
[[[ END 'use Inline' STAGE for 'RPerl/HelperFunctions.cpp' ]]]
Having more than one /x regexp modifier is deprecated at /home/someuser/perl5/lib/perl5/Perl/Critic/Policy/ValuesAndExpressions/RequireInterpolationOfMetachars.pm line 110.
Verbose Flag......... 0
Debug Flag........... 0
in rperl, have $RPerl::DEBUG = 0, $ENV{RPERL_DEBUG} = 1
in rperl, have $RPerl::VERBOSE = 0, $ENV{RPERL_VERBOSE} = 1
Input File: hello_world_constants.pl
Output File(s): hello_world_constants.cpp hello_world_constants
Modes: magic => LOW, code => CPP, ops => CPP, types => CPP, check => TRACE, uncompile => OFF, compile => SUBCOMPILE, subcompile => DYNAMIC, parallel => OFF, execute => ON, label => ON
DEPENDENCIES: Follow & find all deps... 0 found.
PARSE PHASE 0: Check Perl syntax... done.
PARSE PHASE 1: Criticize Perl syntax... done.
PARSE PHASE 2: Parse RPerl syntax... done.
GENERATE: Generate C++ syntax... Use of uninitialized value in hash element at /home/someuser/github_repos/rperl-latest/lib/RPerl/CompileUnit/Constant.pm line 113.
Use of uninitialized value in hash element at /home/someuser/github_repos/rperl-latest/lib/RPerl/CompileUnit/Constant.pm line 127.
done.
ERROR ECOCOFI00, COMPILER, SAVE OUTPUT FILES: Expecting file name for suffix 'H', but received empty or no value, croaking at /home/someuser/github_repos/rperl-latest/script/rperl line 850.
BAILING OUT: One or more problems encountered, see error messages above for details, dying
These errors are not present if we simply remove the constant PIE() from the code.
The text was updated successfully, but these errors were encountered:
This issue was first reported by @birdty
The following file
hello_world_constants.pl
should compile without any errors:However, we see there are issues when attempting to compile a constant such as PIE() inside a
.pl
file:These errors are not present if we simply remove the constant PIE() from the code.
The text was updated successfully, but these errors were encountered: