Loose-Info.com
Last Update 2008/05/18
TOP - Perl - 関数 - undef

変数などを未定義とし、領域を再利用可能とします。
引数を省略した場合は単純に未定義値を返します。

undef 式1

式1
未定義値とする変数などが記述された式

(例)
$s_test = "abc"; print "undef前 : $s_test\n"; undef($s_test); print "undef後 : $s_test\n"; if (! defined($s_test)) { print "未定義\n"; }

実行結果
undef前 : abc undef後 : 未定義