Let have a code:
use 5.014;
use warnings;
my $def = 'default_value';
# this works,.
# e.g. unless here are some arguments
# assigns to element0 the value $def
my(@arr) = (@ARGV);
push @arr, $def unless @arr;
say "args: @arr";
# this also works
# same for scalar - ARGV[0]
my $a1 = $ARGV[0] // $def;
say "arg1: $a1";
Exists some shorten way to assign default values to the array if here no @ARGV?
#this not works
#my(@arr) = (@ARGV) // ('def');