perl中$word = $&;是什么意思啊?
while ($inputline = <STDIN>) {
while ($inputline =~ /\b[A-Z]\S+/g) {
$word = $&;
$word =~ s/[;.,:-]$//; # remove punctuation
for ($count = 1; $count <= @wordlist;
$count++) {
$found = 0;
if ($wordlist[$count-1] eq $word) {
$found = 1;
$wordcount[$count-1] += 1;
last;
}
}
if ($found == 0) {
$oldlength = @wordlist;
$wordlist[$oldlength] = $word;
$wordcount[$oldlength] = 1;
}
}
}
$word = $&;是什么意思?