-1

I am wondering what the characters \. mean in Perl, specifically in a matching expression. I know the \ can be an escape character. Is it simply escaping the dot? Or does it have an additional meaning together?

In the context below, I am assuming that when the condition ($ARGV[$i] =~ /\./) is satisfied, the variable $Chain is not set to the argument $ARGV[$i]. I tried looking up information on Perl regular expressions and matching but I am having trouble fitting the context.

for (my $i = 0; $i <= $#ARGV; $i++) {
    if ($ARGV[$i] && ! ($ARGV[$i] =~ /\./)) {
        $Chain .= " " .  $ARGV[$i];
    }
}
Dan Lowe
  • 37,115
  • 15
  • 104
  • 98
  • This is addressed early in `perlre(1)` in the section that discusses V8 regex syntax. http://perldoc.perl.org/perlre.html#Version-8-Regular-Expressions – Dan Lowe Aug 25 '15 at 15:02

1 Answers1

7

It's escaping the period so that it can match a period instead of using the period's usual special meaning.

Almo
  • 14,789
  • 13
  • 64
  • 91