配列型変数2

#07 配列変数を使ってみよう (2) use strict; use warnings; my @sales = (150,200,300); # my @colors = ('red','green'); my @mixed = (150,'red',1.5); print $sales[1]; print @sales[1..$#sales]; 200200300 と表示されることを確認。 配列からある特定…

配列型変数1

#06 配列変数を使ってみよう (1) use strict; use warnings; my @sales = (150,200,300); # my @colors = ('red','green'); my @mixed = (150,'red',1.5); print @sales; my @inc = (1..100); my @colors = qw(red green); print @inc; print @colors; 15020…

文字列を扱ってみよう

#05 文字列を扱ってみよう 簡易的なプログラムを作成。 #word.pl use strict; use warnings; my $name = "tom"; my $s = "he\tllo, $name \n"; my $b = 'hel\tlo'; print $s; print "hello" x 5; he llo, tom hellohellohellohellohello と表示されることを…

数値を扱ってみよう

#04 数値を扱ってみよう 演算子などは、Javaと大差ないので、問題なかったです。 #文法チェック use strict; use warnings; my $x = 10; my $y = 10.7; my $z = 123_234_235; my $xx = 10 * 10; # => 100 my $yy = 10 % 3; # => 1 my $zz = 2 ** 3; # => 8 $…

スカラー変数を使ってみよう

#03 スカラー変数を使ってみよう 変数:データ(スカラー値、配列、ハッシュ)につけるラベル スカラー:(単一の値:数値、文字列)変数:$ hello.pl内に追記/変更 #文法チェック use strict; use warnings; my $test; $test = "hello world"; print $test;…

はじめてのPerlプログラム

#02 はじめてのPerlプログラム ファイルhello.plを作成する #hello.pl $ print("hello world\n"); SSHからperlコマンドでコンパイル/実行する $ perl hello.pl hello world と表示されることを確認

ドットインストールを見ながらPerlを学ぶ

ドットインストールを見ながらPerlを学ぶ (参考:http://dotinstall.com/lessons/basic_perl/9201) #01 Perlとはなにか? 概要 テキスト処理から大規模なシステムを作成できる。 自由度の高い書き方が可能。 Perl公式サイト 利用するための知識 unixコマン…

perlインストールとperlbrewのインストール

perlインストールとperlbrew のインストール (参照:http://oooooooo.hatenablog.com/entry/2013/12/03/224109) perlbrew をインストール。 $ sudo cpan App::perlbrew perlbrew initで初期化を行おうとしたところ、 perlbrew: Command not found が表示さ…

screenのインストール

screenのインストール $ cd /usr/ports/ $ whereis screen $ cd /usr/ports/sysutils/screen $ sudo make install clean screenの設定 $ cat ~/.screenrc caption always "%{= wk} %-w%{=bu dr}%n %t%{-}%+w %= %{=b wb}%y/%m/%d(%D) %{=b wb}%c" 利用時には…

Vagrantを利用し、仮想でFreeBSD9を立てる。

作業内容 vagrantのダウンロード/インストール Vimのインストール スナップショットを取る/確認する/削除する VIM操作方法確認(ドットインストールを参照) Vagrantのダウンロード/インストール #ディレクトリの作成 $ mkdir freebsd9 #ディレクトリ移動 $ …

VIMの基本操作 その1

作業内容 * VIM操作方法|! * GitとNeoBoundleのインストール * Vundleのダウンロード # VIMのバージョン情報等 $vim VIM - Vi IMproved version 7.3.1314 by Bram Moolenaar et al. Vim is open source and freely distributable Help poor children in Ugan…