title: How can I output a die() message without the location information?
body: <p>I've got a script that throws an exception via <code>die</code>. When I catch the exception I want to output the message without the location information attached.</p>
  
  <p>This script:</p>
  
  <pre><code>#! /usr/bin/perl -w
  
  use strict;
  
  eval {
      die "My error message";
  };
  if($@) {
      print $@;
  }
  </code></pre>
  
  <p>outputs
  <code>My error message at d:\src\test.pl line 7.</code></p>
  
  <p>I would prefer just to get the output:
  <code>My error message</code></p>
  
  <p>Hopefully people don't focus on why I want to do it but if someone is interested then:</p>
  
  <p>The way my script works, it looks for input and dispatches each piece of input to a handler, if it comes across a piece of input that it can't handle then it throws, so all the exceptions are coming from the same piece of code. Hence the location isn't terribly helpful in this situation.</p>