Initialize the source_file with default value before invoking the getOptions function.
my $source_file= "source.txt getopts ("hc:f:o:", \%options); usage() if $options{h}; $source_file= $options{o} if (defined($options{o});

In reply to Re: question about getopt by hifirock
in thread question about getopt by Sun751

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":