]> mj.ucw.cz Git - libucw.git/commitdiff
UCW::CGI: Use "//=" to simplify code
authorMartin Mares <mj@ucw.cz>
Tue, 16 Oct 2012 13:20:10 +0000 (15:20 +0200)
committerMartin Mares <mj@ucw.cz>
Tue, 16 Oct 2012 13:20:10 +0000 (15:20 +0200)
This patch and the previous one have been suggested by Tomas Malecek.

ucw/perl/UCW/CGI.pm

index afb3c76fa62ff10d8611a25bb80fb26f27a9eac0..b90b8d2951b2380b657176e9955e7afe3f0428d4 100644 (file)
@@ -204,7 +204,7 @@ sub parse_args($) {                 # CAVEAT: attached files must be defined in the main arg t
 
        for my $a (values %$args) {
                my $r = ref($a->{'var'});
-               defined($a->{'default'}) or $a->{'default'}="";
+               $a->{'default'} //= '';
                if ($r eq 'SCALAR') {
                        ${$a->{'var'}} = $a->{'default'};
                } elsif ($r eq 'ARRAY') {