#!/usr/bin/perl -w use strict; use Error::Custom; synopsis() unless @ARGV; system(@args); check_call('custom message',@args); # this lives in Error::Custom system(@args1); check_call('more custom messages',@args1); exit; sub synopsis { # note that $0 contains the script name so the name will # always be the correct one no matter what you call the script print " Synopsis $0 SOME_FLAG SOME_ARG blah blah\n\n"; exit; }