アウトプットができる技術者に

it's a time to take a new step !

2013-03-02から1日間の記事一覧

型変換

num = 1 p "num=" + String(num) # => num=1

Perl 配列

@変数名で定義する。 # sample.1 @items = ("a","b","c","d"); # 1-100 まで定義 @items = (1..100); # sample.2 (quoated words. シングルクオートを省略できる) @items = ('a','b','c'); @items = qw(a b c); @items = qw /a b c/; 出力 print($items[0] .…

ファイル読み込み

open(IN, "w.txt"); while(<IN>){ print; } close(IN);</in>

ファイル書き込み

open(OUT,"> w.txt"); print OUT "a"; close(OUT);

OfficialSite

http://perldoc.perl.org/perl.html

小数点第2位で切り捨て

printf("%.2f",1.255); sprintf("%.2f",1.255);