10 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
sub process
{
my $name = $_[0];#erwartete variable
if($wortliste{$name}==1)
{
return '';
}
foreach my $temp (split ',', $connected{$name}) # alle mit $name verbundenen ausdrücke
{
$wortliste{$name}=1;
if($wortliste{$temp}==1)
{
next;
}
push (our @results,"\t".$temp);
process($temp);
}
return our $results;
push(@results,["\t".$temp,$layer]);
1
2
3
4
5
foreach my $ausgabe(@results)
{
print"Ausgabe: $ausgabe \n";
} print "Das ist i: ",$i,"\n";
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#! /usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
my $arrayref = process('test',0);
foreach(@{$arrayref}){
print "Value: ",$_->[0],"\tLayer: ",$_->[1],"\n";
}
sub process{
my ($name,$layer) = @_;
$layer++;
my @results;
return \@results if($layer == 4);
foreach(0..5){
push(@results,[$_,$layer]);
push(@results,@{process('name',$layer)}) if($_ == 3);
}
return \@results;
}
10 Einträge, 1 Seite |