mojocasts 에피소드 2와 함께 mojolicious를 배우십시오. 내가 서버에서이 오류 주소 http://127.0.0.1:3000/sayth/renshaw
로 이동 그러나 때mojolicious - barewords - mojocast 2
나는
#!/usr/bin/env perl
use Mojolicious::Lite;
get '/:fname/:lname' => sub {
shift->render('hello');
};
app->start;
__DATA__
@@ hello.html.ep
<!doctype html><html>
<head><title>Placeholders</title></head>
<body><i>Hello <%= fname %> <%= $lname %></li></body>
</html>
의 예제를 가지고있다.
[Fri Apr 25 15:59:05 2014] [error] Bareword "fname" not allowed while "strict subs" in use at template hello.html.ep from DATA section line 3, <DATA> line 17.
1: <!doctype html><html>
2: <head><title>Placeholders</title></head>
3: <body><i>Hello <%= fname %> <%= $lname %></li></body>
4: </html>
엄격한 서브를 지정했다고 생각하지 않습니다. 어떻게 해결합니까?
편집 : perl 5.16.3이 설치된 컬 (curl)로 설치된 최신 버전을 실행 중입니다.
템플릿의'fname' 앞에'$'가 필요합니다. – stevenl