在编写perl脚本时我与Index和Rindex混淆.Perl中的Index和Rindex之间有什么区别(用简单的例子解释)
perl -E 'say rindex("bar foo bar foo", "foo")'
^__ found first substring from right side
12
perl -E 'say index("bar foo bar foo", "foo")'
^__ found first substring from left side
4
Run Code Online (Sandbox Code Playgroud)