나는 Learning Perl 6th Edition의 제 2 장 연습 문제 2 페이지 42에 붙어 있습니다. 296 페이지에서 문제의 코드 예제를 복사했습니다. Ubuntu 11.04에서 Perl 버전 5.10.1을 사용하고 있습니다. 나는 누군가가 도와 줄 수 있는지 알 수없는 오류가 발생합니까? 아래에 코드와 오류 메시지가 표시됩니다.'Learning Perl 6th Edition'의이 예제가 실행되지 않는 이유는 무엇입니까?
#!/usr/bin/perl -w
$pi = 3.141592654;
print "What is the radius? ";
chomp($radius = <STDIN>);
$circ = 2 * $pi * $radius;
print "The circumference of a circle of radius $radius is $circ.\n";
내가 오류는 다음과 같습니다 당신은 perl
대신 쉘을 사용하여 Perl 스크립트를 실행하는
./ex2-2: line 3: =: command not found
Warning: unknown mime-type for "What is the radius? " -- using "application/octet-stream"
Error: no such file "What is the radius? "
./ex2-2: line 5: syntax error near unexpected token `$radius'
./ex2-2: line 5: `chomp($radius = <STDIN>);'
CGI 스크립트로 실행하려고하는 것처럼 들리지만 어떻게 실행 했습니까 (어떤 명령을 입력 했습니까)? –