Thread Referenzen (3 answers)
Opened by pktm at 2008-05-20 11:52

renee
 2008-05-20 12:14
#109978 #109978
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Gibt es Fehlermeldungen? Prinzipiell sollte es nämlich so gehen wie Du das gemacht hast:

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/perl

use strict;
use warnings;
use Data::Dumper;

my @array = (
  { test => 1, test2 => 3},{ test => 1, test2 => 3},
  { test => 1, test2 => 3},{ test => 1, test2 => 3}
);

print Dumper \@array;

x(\@array);

print Dumper \@array;

sub x{
   my $p = shift;
   for my $i ( 0..3 ){
      $p->[$i]->{test2} = 'etwas anderes';
   }
}
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
C:\>perl test.pl
$VAR1 = [
{
'test' => 1,
'test2' => 3
},
{
'test' => 1,
'test2' => 3
},
{
'test' => 1,
'test2' => 3
},
{
'test' => 1,
'test2' => 3
}
];
$VAR1 = [
{
'test' => 1,
'test2' => 'etwas anderes'
},
{
'test' => 1,
'test2' => 'etwas anderes'
},
{
'test' => 1,
'test2' => 'etwas anderes'
},
{
'test' => 1,
'test2' => 'etwas anderes'
}
];
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 Referenzen