in reply to default option

The problem of your approach is that the variables are not set to the default values. If you want to keep the values close to the variables, but you're lazy to repeat the variable names, you can try something like
#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; use Getopt::Long; GetOptions( 'x=s' => \(my $x = 'X'), 'y=s' => \(my $y = 'Y'), ); say "$x|$y";

Example session:

$ 1.pl X|Y $ 1.pl -x abc abc|Y $ 1.pl -y def X|def $ 1.pl -x abc -y ghi abc|ghi

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: default option
by Discipulus (Canon) on Apr 12, 2016 at 20:02 UTC
    'x=s' => \(my $x = 'X'),
    very lazy, ++choroba! never seen.

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.