Using die to ouput error message : die « System Functions « Perl






Using die to ouput error message

      


#!/usr/bin/perl -w

use strict;

print "enter a string to pass to die: ";
chomp(my $string = <STDIN>);

die($string);

   
    
    
    
    
    
  








Related examples in the same category

1.The die function exits the Perl script and prints out an error message to STDERR
2.Using function 'die' to terminate a program