8 Einträge, 1 Seite |
1 2 3 4 5 6 7 8 9 10 11 12 13
#!/usr/bin/perl use strict; use warnings; my @array=("abc","1,2,3","T","pu,pr"); my ($dyn_one,$dyn_two) = @array[1,3]; for my $i ( split /,/, $dyn_one ){ for my $end ( split /,/, $dyn_two ){ print sprintf "%s%s%s%s\n", $array[0],$i,$array[2],$end; } }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#!/usr/bin/perl use strict; use warnings; my @array=("abc","1,2,3","T","pu,pr"); my @strings = (shift @array); for my $i ( @array ){ if( index($i, ',') != -1 ){ @strings = map{my $j = $_; map{ $_ . $j }@strings}split /,/, $i; } else{ $_ .= $i for @strings; } } print $_,"\n" for @strings;
lichtkind+2007-10-11 01:09:10--gibts aber auch schon fertige module dazu
8 Einträge, 1 Seite |