1
2
3
4
5
6
7
8
our @workflow = (
{State => "Blah",
Followup => "Blubb",
},
{State => "Blah2",
Followup => "Blubb2",
},
);
1
2
3
require 'externedatei'.$n;
machwasmit $workflow[$i]{State}
machwasmit $workflow[$i]{Followup}
QuoteUnd was soll Perl können müssen?Sowas wie c++-präprozessor kann Perl afaik nicht.
1 2 3 4 5 6 7 8
our @workflow = ( {State => "Blah", Followup => "Blubb", }, {State => "Blah2", Followup => "Blubb2", }, );
1 2 3 4
$i=1; require "$i.pm"; print $workflow[$i]{State}, "\n"; print $workflow[$i]{Followup}, "\n";
1 2 3 4 5 6 7 8 9 10
$ echo '{a=>1},{a=>2}' | perl -Mstrict -MData::Dumper -e 'my @l=do "/dev/fd/0"; print Dumper \@l' $VAR1 = [ { 'a' => 1 }, { 'a' => 2 } ];
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
package My::P1; BEGIN { { package My::P1::_dbg; use Filter::Simple sub { s/^(\s*)#D /$1/mg if $ENV{"My__P1___dbg"}; }; } My::P1::_dbg->import; } use strict; sub new { my $I=bless \(my $x)=>__PACKAGE__; #D warn "$I is born\n"; $I; } #D sub DESTROY { #D warn "$_[0] went out of scope\n"; #D } 1;
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";
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 2 3 4 5 6 7 8 9 10 11
use strict; use warnings; our @workflow = ( {State => "Blah", Followup => "Blubb", }, {State => "Blah2", Followup => "Blubb2", }, );