Future commits will cause regcomp.c to try to compile user-defined
properties. The caller stack is different for this, and there may be a
package name as well that differs from the existing scheme. This commit
allows for this.
# regcomp.c surrounds the property name with '__" and '_i' if this
# is to be caseless matching.
- my $caseless = $type =~ s/^__(.*)_i$/$1/;
+ my $caseless = $type =~ s/^(.*)__(.*)_i$/$1$2/;
print STDERR __LINE__, ": type=$type, caseless=$caseless\n" if DEBUG;
## package if no package given
##
- my $caller1 = $type =~ s/(.+)::// ? $1 : caller(1);
+
+ my $caller0 = caller(0);
+ my $caller1 = $type =~ s/(.+)::// ? $1 : $caller0 eq 'main' ?
+ 'main' : caller(1);
if (defined $caller1 && $type =~ /^I[ns]\w+$/) {
my $prop = "${caller1}::$type";