Tutorials Point


  Perl Home

  PERL Functions

© 2011 TutorialsPoint.COM


  Home     References     About TP     Advertising  

PERL die Function



Syntax

die LIST


Definition and Usage

Prints the value of LIST to STDERR and calls exit with the error value contained in $!.

Return Value

  • Nothing

Example

Following are the usage...

    die "Can't cd to spool: $!\n" unless chdir '/usr/spool/news';
or
    chdir '/usr/spool/news' or die "Can't cd to spool: $!\n"
or
    open( FILEH, ">/tmp/test" ) || die( "Can't open file test $!\n" );


Printer Friendly



  

Advertisement

Online Image Processing

Indian Baby Names