aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Hernan Czernikier <gaboherno@gmail.com>2014-10-29 20:24:14 -0300
committerGabriel Hernan Czernikier <gaboherno@gmail.com>2014-10-29 20:24:14 -0300
commitba1b3511d6d6d45d7db1d076e86ad7c46d32d3d5 (patch)
tree640c2d2f98018d6352d8f648373b91b9f486bc71
parentbcc8387a2ed68c578ea4495a0c527a86f5c4f7f2 (diff)
downloadvital-ba1b3511d6d6d45d7db1d076e86ad7c46d32d3d5.tar.gz
vital-ba1b3511d6d6d45d7db1d076e86ad7c46d32d3d5.tar.bz2
Renaming of a local variable $underscore due to syntax
-rw-r--r--TokensV2.pm18
1 files changed, 9 insertions, 9 deletions
diff --git a/TokensV2.pm b/TokensV2.pm
index 619d7df..c38ef39 100644
--- a/TokensV2.pm
+++ b/TokensV2.pm
@@ -36,7 +36,7 @@ sub digest_single { # $target, $regex, $eaten_left_literal_chars, $eaten_right
return unless ($_[2]+$_[3])/$literal_char_count<0.999999;
return @{$DIGEST_SINGLE[$_[2]][$_[3]]} if defined $DIGEST_SINGLE[$_[2]][$_[3]];
pos($_[0]) = undef;
- goto VISITING unless $_[0] =~ /(${_[1]})/g;
+ goto VISITING unless $_[0] =~ /(${_[1]})/g; # SUCCESSFULL MATCH
my $digit = 2;
while( my $cg = eval '$'.$digit++ ) {
my @suspicious_tokens = $cg =~ /$long_tokens/g;
@@ -152,17 +152,17 @@ sub parse {
@MASK = ();
my $target = shift;
my $regex = shift;
- while($regex =~ /^(.+)$/mg) {
- my $_ = $1;
- my $other = $_;
+ while($regex =~ /^(.+)$/mog) {
+ my $underscore = $1;
+ my $other = $underscore;
# strip out non-literal chars from MASK
- $other =~ s/\(\?:(.+?)\)\+/\1/g;
- $other =~ s/\(\?:(.+?)\)\?/\1/g;
- $other =~ s/\.\*\?//g;
+ $other =~ s/\(\?:(.+?)\)\+/\1/og;
+ $other =~ s/\(\?:(.+?)\)\?/\1/og;
+ $other =~ s/\.\*\?//og;
push @MASK, $other;
# surround wildcards with capturing group for REGEX
- s/(\.\*\?)/\(\1\)/g;
- push @REGEX, $_;
+ s/(\.\*\?)/\(\1\)/og;
+ push @REGEX, $underscore;
}
$long_tokens = '\b' . join '\b|\b', grep length>=3,keys %{+{ map +($_=>undef), map /\w+/g, @REGEX }};

Return to:

Send suggestions and report system problems to the System administrator.