「一気に最後まで読んだ」本、教えて下さい!

https://ideone.com/mjkvC9の下記のperlが動かない。

my $t = get();
say DateTime.new( floor( $t / 1e6 ) - 11644473600,
timezone=>9*3600,
formatter=>{ sprintf '%04d-%02d-%02d %02d:%02d:%02d', .year, .month, .day, .hour, .minute, .second } );


下記のエラーが出る。
Unquoted string "year" may clash with future reserved word at 03.pl line 4.
Unquoted string "month" may clash with future reserved word at 03.pl line 4.
Unquoted string "day" may clash with future reserved word at 03.pl line 4.
Unquoted string "hour" may clash with future reserved word at 03.pl line 4.
Unquoted string "minute" may clash with future reserved word at 03.pl line 4.
Unquoted string "second" may clash with future reserved word at 03.pl line 4.
syntax error at 03.pl line 4, near ", ."
03.pl had compilation errors.

済みません。修正箇所を指摘願います。

A 回答 (1件)

perl6での話かと思います。


あなたの実行環境もperl6である前提ですが、
先頭に
use v6;
を入れてみてはいかがでしょうか。

申し訳ありませんが、当方、perl6は持っていませんので、こちらで確認していません。
外していたら、ごめんなさい。
    • good
    • 0
この回答へのお礼

素早い回答、有り難うございます。

私の勘違いでした。バージョンが5になっていました。
有難うございました。

お礼日時:2018/07/25 15:29

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!