in reply to Returning an error message when <STDIN> is not in use

For something like this, I would probably inspect the @ARGV array and call a usage() subroutine if:

Update: Dang! Beat to the punch by ikegami! :)

A sample usage() subroutine might look like this:

sub usage { die "You must specify an input file.\nUsage: $0 <file_name>\n"; }