Thread Array of Hashes aus externer Datei includen? (5 answers)
Opened by undersok at 2011-09-30 11:19

GwenDragon
 2011-09-30 12:44
#152799 #152799
User since
2005-01-17
14748 Artikel
Admin1
[Homepage]
user image
Zweite Version mit user strict + warnings. ;)

main.pl
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
use strict;
use warnings;

my $i=1;

our @workflow;
require "$i.pm";

print $workflow[$i]{State}, "\n";
print $workflow[$i]{Followup}, "\n";
oder
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
use strict;
use warnings;

my $i=1;

use vars qw/@workflow/;
require "$i.pm";

print $workflow[$i]{State}, "\n";
print $workflow[$i]{Followup}, "\n";


1.pm
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
use strict;
use warnings;

our @workflow = (
  {State                  => "Blah",
   Followup               => "Blubb",
  },
  {State                  => "Blah2",
   Followup               => "Blubb2",
  },
);

Last edited: 2011-09-30 12:47:21 +0200 (CEST)

View full thread Array of Hashes aus externer Datei includen?