Leser: 2
![]() |
|< 1 2 3 >| | ![]() |
28 Einträge, 3 Seiten |
1 2 3 4 5
my %hash; my $nixdrin; $hash{$nixdrin}++; Use of uninitialized value in hash element at - line 3.
1 2 3 4 5 6 7 8 9 10 11 12
#!/usr/bin/perl use strict; use warnings; use Benchmark qw/cmpthese/; my %hash; my $key="foo"; cmpthese (-10, { ohne => sub { $hash{$key}=0; $hash{$key}++ for 0 .. 1_000_000; }, mit => sub { $hash{"$key"}=0; $hash{"$key"}++ for 0 .. 1_000_000; }, });
1
2
3
4
5
6
Benchmark: running mit, ohne for at least 10 CPU seconds...
mit: 11 wallclock secs (10.36 usr + 0.01 sys = 10.37 CPU) @ 0.87/s (n=9)
ohne: 11 wallclock secs (10.12 usr + 0.02 sys = 10.14 CPU) @ 2.66/s (n=27)
s/iter mit ohne
mit 1.15 -- -67%
ohne 0.376 207% --
1 2 3 4 5
my %hash; my $nixdrin; $hash{$nixdrin}++; Use of uninitialized value in hash element at - line 3.
1 2 3 4 5 6 7
my %hash = ( "bla bla" => 1, ); my $bla = 'bla bla'; print $hash{$bla}; <= kein Fehler .. ohne " print $hash{bla bla}; <= Fehler
$var = $var || 0;
1 2 3
sub _{s;;xrqIpiql\\{}p{pl{R>rl{N{}gjwpkssq]>rl{N;;;*{{}=*{_};; ${{}={q{{{}}}=>[reverse+split+reverse+q;}{;]};${{}->{q{{{}}}}->[@{{}];} ${{}=reverse+_(q{{}}=>q{{}})^chr(30)x+length&_(q{{}}=>,q{{}})and+print;
1 2 3 4 5
my $bla = 'bla bla'; my $var = bla bla; # Fehler! my $var = $bla; # Richtig my $var = "$bla"; # Syntaktisch korrekt, aber unschoen.
1 2 3 4 5 6 7
my %wurzel; $wurzel{$_*$_} = $_ for 1 .. 20; ##### my %lastonline; $lastonline{param('user')} = time;
1 2 3 4 5 6
foreach my $lines(@log) { if($lines =~ /\"(.+)<.+><(.+)><>\" entered the game/) { my($name,$wonid) = (ũ,Ū); } }
1
2
3
4
"BrownWolf<..><8957333><>" entered the game
"Bla<..><8374444><>" entered the game
"Barbara<..><885333><>" entered the game
"BrownWolf<..><8957333><>" entered the game
"Brown<..><8957333><>" entered the game
1 2 3
sub _{s;;xrqIpiql\\{}p{pl{R>rl{N{}gjwpkssq]>rl{N;;;*{{}=*{_};; ${{}={q{{{}}}=>[reverse+split+reverse+q;}{;]};${{}->{q{{{}}}}->[@{{}];} ${{}=reverse+_(q{{}}=>q{{}})^chr(30)x+length&_(q{{}}=>,q{{}})and+print;
![]() |
|< 1 2 3 >| | ![]() |
28 Einträge, 3 Seiten |