構文 |
|
undef 変数 |
返り値 |
|
未定義値 |
説明
- 変数を未定義にします。
- 常に未定義値を返します。
使用例
#!/usr/bin/perl
use strict;
use warnings;
my $foo = 100;
undef $foo;
if (defined $foo) {
print "defined.\n";
} else {
print "undefined.\n";
}
#!/usr/bin/perl
use strict;
use warnings;
my $foo = "hoge,fuga";
my (undef, $data) = split /,/, $foo;
print $data, "\n";