in reply to Problem with Getopt::Long and Pod::Usage

By default, Getopt::Long does not check if you didn't specify an option. From the POD:
Options are not necessary for the program to work, hence the name 'option'

Since you require the input file --in option, you need a check to see if the user specified it:

pod2usage(-verbose => 1) unless defined $infile;

Another possibility is to provide a default value for $infile in your code.

Replies are listed 'Best First'.
Re^2: Problem with Getopt::Long and Pod::Usage
by mocnii (Acolyte) on Feb 12, 2014 at 16:33 UTC
    Yes thank you this works.