我需要帮助调整我的代码块.一切正常,但随后它停止工作并且每次都失败(打印).我究竟做错了什么?
print "Enter a word to search for:";
chomp (my $word = <STDIN> );
if (not -e $word){
print "No such word found.\n";
exit;
}
Run Code Online (Sandbox Code Playgroud)
整个计划.
#!/usr/bin/perl -w
use strict;
print "Welcome to the word frequency calculator.\n";
print "This program prompts the user for a file to open, \n";
print "then it prompts for a word to search for in that file,\n";
print "finally the frequency of the word is displayed.\n";
print " \n";
print "Please enter the name of …Run Code Online (Sandbox Code Playgroud)