Movatterモバイル変換


[0]ホーム

URL:


functions /undef
(source,CPAN)
You are viewing the version of this documentation from Perl 5.40.1.View the latest version
#undef EXPR
#undef

Undefines the value of EXPR, which must be an lvalue. Use only on a scalar value, an array (using@), a hash (using%), a subroutine (using&), or a typeglob (using*). Sayingundef $hash{$key} will probably not do what you expect on most predefined variables or DBM list values, so don't do that; seedelete. Always returns the undefined value. You can omit the EXPR, in which case nothing is undefined, but you still get an undefined value that you could, for instance, return from a subroutine, assign to a variable, or pass as a parameter. Examples:

undef $foo;undef $bar{'blurfl'};      # Compare to: delete $bar{'blurfl'};undef @ary;undef %hash;undef &mysub;undef *xyz;       # destroys $xyz, @xyz, %xyz, &xyz, etc.return (wantarray ? (undef, $errmsg) : undef) if $they_blew_it;select undef, undef, undef, 0.25;my ($x, $y, undef, $z) = foo();    # Ignore third value returned

Note that this is a unary operator, not a list operator.

Perldoc Browser is maintained by Dan Book (DBOOK). Please contact him via theGitHub issue tracker oremail regarding any issues with the site itself, search, or rendering of documentation.

The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via thePerl issue tracker, themailing list, orIRC to report any issues with the contents or format of the documentation.


[8]ページ先頭

©2009-2025 Movatter.jp