1 2 3 4 5 6 7 8 9 10
#!/usr/bin/perl -w use strict; use warnings; my %FORM = ( a=>'abc', b=>'defg', ); print "Test: '".length(join('',map {defined($FORM{$_}) ? $_.$FORM{$_} : $_} keys %FORM))."'\n";
2013-05-07T17:18:10 bianca2013-05-07T17:11:56 pqDas bringt nicht 9 sondern 5 raus.say do { no warnings; length join "", %FORM };
welche perl-version?
Code: (dl )1
2
3
4
5
6
7
8
9
10
11
12
13$ perl -wE'
my %FORM = ( a => "abc", b => "defg" );
say do { no warnings; length join "", %FORM };
say $];'
9
5.010001
$ perl -wE'
my %FORM = ( a => "abc", b => "defg" );
say do { no warnings; length join "", %FORM };
say $];'
9
5.016000
2013-05-07T17:25:25 pq
QuoteThis is perl, v5.10.1 (*) built for MSWin32-x86-multi-thread
1 2 3 4
use 5.010; my %FORM = ( a => "abc", b => "defg" ); say for %FORM; say join "", %FORM;
2013-05-07T17:35:48 pqda hast du aber dann eine kaputte version.
was sagt:
Code (perl): (dl )1 2 3 4use 5.010; my %FORM = ( a => "abc", b => "defg" ); say for %FORM; say join "", %FORM;
?
Quotea
abc
b
defg
aabcbdefg
2013-05-07T17:35:48 pqNein, keineswegs.oder ist dir das egal?
1 2 3 4 5 6 7
use 5.010; my %FORM = ( a => "abc", b => "defg" ); say for %FORM; say join "", %FORM; my $x = length join "", %FORM; say $x; say length join "", %FORM;
2013-05-07T18:16:00 pqund was sagt:
Code (perl): (dl )1 2 3 4 5 6 7use 5.010; my %FORM = ( a => "abc", b => "defg" ); say for %FORM; say join "", %FORM; my $x = length join "", %FORM; say $x; say length join "", %FORM;
?
Quotea
abc
b
defg
aabcbdefg
9
9
1 2 3
# betrachte den hash als array my @helper = %FORM; print length join '', @helper;
2013-05-07T17:36:38 rostiWenn Dich eine Kopie nicht stört:
2013-05-07T17:36:38 rosti# betrachte den hash als array
print length join "", %form;