in reply to shift or die unless

You described your goal like this:
the script will run whether the arg is there or not and if its not, check the modification date of a file and if its a week old, run a certain sub.

I don't see any indication of trapping an error condition, so why do you have:  die "takes one arg"? If I understand your description, the idea is:

  1. If there is something in @ARGV, do something with that.
  2. else, if $file is older than 7 days, call a subroutine
  3. else exit (nothing to do, except may explain to the user why nothing was done).
If you feel compelled to put all that in one statement, I'd feel compelled to ask why. Spreading it out a bit does not create any problems, and does clarify the intent:
if ( @ARGV ) { do_something( shift ); } elsif ( -M $file > 7 ) { do_something_else(); } else { warn "Nothing to do ($file is recent, and you gave no arg to work +on)\n"; warn "Usage: $0 [optional_arg_that_does_what_exactly]\n"; } # default exit status will be "0" (success)
If the "nothing to do" condition should really be treated as a failure, use die instead of warn with the "Usage: ..." message. You would also use die (or Carp::croak) in your subroutines, or check their return values and die after the call, if necessary.