1
2
3
4
5
6
7
8
9
10
11
12
13
14
given ($site->{FILETYP}) {
when("package") { $logger->debug("no 2. run"); }
when("profile") { $logger->debug("2. run required!");
my $sp_ret = 0;
foreach my $cont (@contend) {
$sp_ret = storeContend($cont, $site->{OS}, \$logger);
if($sp_ret == 255) {
unshift(@wrongs, $cont); # store file in error array
}
}
}
when("host") { $logger->debug("no 2. run"); }
when("log") { $logger->debug("no 2. run"); }
}
1
2
3
4
5
6
7
8
9
10
11
12
given is experimental at private/PSubs.pm line 133.
when is experimental at private/PSubs.pm line 135.
when is experimental at private/PSubs.pm line 136.
when is experimental at private/PSubs.pm line 137.
when is experimental at private/PSubs.pm line 138.
given is experimental at private/PSubs.pm line 234.
when is experimental at private/PSubs.pm line 235.
when is experimental at private/PSubs.pm line 239.
when is experimental at private/PSubs.pm line 246.
when is experimental at private/PSubs.pm line 250.
given is experimental at ./check.pl line 360.
when is experimental at ./check.pl line 361.
no if $] >= 5.018, 'warnings', "experimental::smartmatch";
1 2
my %switch = ('package' => sub { ... }, 'profile' => sub { ... }); $switch{$site->{FILETYP}}->();
1 2 3 4 5 6 7 8
my %switch = ( 'package' => sub { ... }, 'profile' => sub { ... } );
1 2 3 4 5 6 7 8
my $package_sub = sub _suppen_paket { ... }; my $profile_sub = sub _prof_feile { ... }; my %switch = ( 'package' => $package_sub, 'profile' => $profile_sub, ); $switch{ $site->{ FILETYP } }->();
no warnings "experimental::smartmatch";
no warnings "experimental";
1 2 3 4 5 6 7
for ($foo->{bar}) { if ($_ eq "foo") { } elsif ($_ eq "bar") { } ... }
2014-02-03T09:52:29 pqüblich war bei sowas auch immer:
Code (perl): (dl )1 2 3 4 5 6 7for ($foo->{bar}) { if ($_ eq "foo") { } elsif ($_ eq "bar") { } ... }
das ist besonders bei regexes praktisch, da man da nichtmal das $_ dazuschreiben muss.