note
ikegami
<p>This wouldn't be an issue at all if you used the standard module [mod://Getopt::Long].
<p>Anyway,
<c>
my $source_file = defined($options{o}) ? $options{o} : 'as.xcf-dist';
</c>
<p>or
<c>
my $source_file = 'as.xcf-dist';
$source_file = $options{o} if defined($options{o});
</c>
<p>or
<c>
my $source_file = $options{o};
$source_file = 'as.xcf-dist' if !defined($options{o});
</c>
<p>or
<c>
sub defined_or { defined($_[0]) ? $_[0] : $_[1] }
my $source_file = defined_or( $options{o}, 'as.xcf-dist' );
</c>
<p>or
<c>
# Requires 5.10
my $source_file = $options{o} // 'as.xcf-dist';
</c>
774909
774909