Subject: | constants wont inline |
In WinError.pm constants can't be inlined because the eval part lacks a
() prototype.
Change
## eval "sub $AUTOLOAD { $val }"; ##
to
## eval "sub $AUTOLOAD () { $val }"; ##
Before fix
..............................................
FUNC: *main::VIEW_S_FIRST
VIEW_S_FIRST not in symbol table
FUNC: *main::VIEW_S_LAST
VIEW_S_LAST not in symbol table
1 <0> enter
# 7: print ERROR_FILE_NOT_FOUND;
2 <;> nextstate(main 241 winerror.pl:7) v:*,&,{,$
3 <0> pushmark s
4 <0> pushmark s
5 <#> gv[*ERROR_FILE_NOT_FOUND] s
6 <1> entersub[t2] lKS/TARG,3
7 <@> print vK
8 <@> leave[1 ref] vKP/REFC
winerror.pl syntax OK
After fix
FUNC: *main::VIEW_S_FIRST
VIEW_S_FIRST not in symbol table
FUNC: *main::VIEW_S_LAST
VIEW_S_LAST not in symbol table
1 <0> enter
# 7: print ERROR_FILE_NOT_FOUND;
2 <;> nextstate(main 241 winerror.pl:7) v:*,&,{,$
3 <0> pushmark s
4 <$> const[IV 2] s
5 <@> print vK
6 <@> leave[1 ref] vKP/REFC
winerror.pl syntax OK
Concise was run as
perl -MO=Concise,-exec,-src,-stash="main" winerror.pl
I am using v5.12.2 and WinError 0.03
Subject: | winerror.pl |
#!/usr/bin/perl -w
use strict;
use Win32::WinError;
BEGIN {
ERROR_FILE_NOT_FOUND();
}
print ERROR_FILE_NOT_FOUND;