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);