The Wayback Machine - https://web.archive.org/web/20151218233743/http://perldoc.perl.org:80/functions/undef.html

Perl version

Modules

  • ABCDE
  • FGHIL
  • MNOPS
  • TUX

undef

Perl 5 version 22.0 documentation

Please note: Many features of this site require JavaScript. You appear to have JavaScript disabled, or are running a non-JavaScript capable web browser.

To get the best experience, please enable JavaScript or download a modern web browser such as Internet Explorer 8, Firefox, Safari, or Google Chrome.

Recently read

undef

  • 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 * ). Saying undef $hash{$key} will probably not do what you expect on most predefined variables or DBM list values, so don't do that; see delete. 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:

    1. undef $foo;
    2. undef $bar{'blurfl'}; # Compare to: delete $bar{'blurfl'};
    3. undef @ary;
    4. undef %hash;
    5. undef &mysub;
    6. undef *xyz; # destroys $xyz, @xyz, %xyz, &xyz, etc.
    7. return (wantarray ? (undef, $errmsg) : undef) if $they_blew_it;
    8. select undef, undef, undef, 0.25;
    9. ($a, $b, undef, $c) = &foo; # Ignore third value returned

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

 
Morty Proxy This is a proxified and sanitized view of the page, visit original site.