Thread verkettung von strings (2 answers)
Opened by Gast at 2007-07-30 17:33

renee
 2007-07-30 17:47
#96841 #96841
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Nimm am Besten einen Hash:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
my %hash = (
  "abc"  => 4,
  "def"   => 8,
);

my $stddev = 0;

my @cons = qw(abc def);

for my $n ( @array ){
    for my $con ( @cons ){
        $stddev += ($n - $hash{$con}) ** 2;
    }
}
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread verkettung von strings