LoginSignup
0
0

More than 5 years have passed since last update.

say "ho!";

Posted at

Perl5.10から実装されていたsay。

書き方

#!/usr/bin/env perl6
use v6;   # なくてもよさげ

# 以下、全て等価
print "ho!\n";
say "ho!";
"ho!".say;
 bash $ ./test.pl
ho!
ho!
ho!

printで出力する形に比べ、3バイト短くできます。
メソッド呼び出しをピリオドでできるのはPerl6ならではですね。

改行コードが環境に依存するのか、常にLFのみなのかは調べきれていません。

0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0