Perl에서 예/아니오로 질문하는 데 어려움이 있으며 방금 알아낼 수 없습니다. 나는 이것에 멍청한 사람이다. 내가 잘못 뭐하는 거지Perl에 문제가있는 경우
#! usr/bin/perl
print "Hello there!\n";
print "What is your favorite game?\n";
$name = <STDIN>;
chomp $name;
print "That's awesome! $name is my favorite game too!\n";
print "Do you think this is a fun script (Y/n) \n";
$status = <STDIN>;
if [ $status = "y" ]: then
print "YAY! I knew you would like it!\n";
if [ $status = "n" ]: then
print "You suck, not me!\n";
?
Perl if 문에서 대괄호를 사용하여 조건을 묶지 않으면 괄호를 사용합니다. 그들은 또한'then' 키워드를 사용하지 않습니다. –