I know I can die but that prints out the script name and line number.
I like to do things like die 'error' if $problem;
Is there a way to do that without printing line number stuff?
It would be nice not to have to use braces if($problem){print 'error';exit}
You could use the fairly natural-sounding:
If you have perl 5.10 or above and add e.g.
use 5.010;
to the top of your script, you can also usesay
, to avoid having to add the newline yourself: