【发布时间】:2013-04-18 17:44:43
【问题描述】:
我测试了以下代码
#! /usr/bin/perl
use strict;
use English;
#this code extracts the current scripts filename
#by removing the path from the filepath
my $Script_Name = $PROGRAM_NAME;
${Script_Name} =~ s/^.*\\//; #windows path
#${Script_Name} =~ s/^.*\///; #Unix based path
print $Script_Name;
我不明白为什么这些大括号在不使用 /r 修饰符的情况下提取匹配项。任何人都可以解释为什么以及如何工作或指向一些文档吗?
【问题讨论】: