6 Einträge, 1 Seite |
my @translations = split/<;>/, $translations;
a<;>eine<;>an<;>eine<;>one<;>eine<;>to have a smoke<;>eine rauchen [ugs.]<;>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
sub {
$result_list->deleteAll();
my @translations = translate_query($query);
my $i = 0;
foreach my $trans (@translations) {
$result_list->add($i++, -itemtype => 'text');
}
}
1 2 3 4 5 6 7 8 9 10 11 12 13
#!/usr/bin/perl use strict; use warnings; my $sep = '<;>'; my $string = 'a<;>eine<;>an<;>eine<;>one<;>eine<;>to have a smoke<;>eine rauchen [ugs.]<;>'; my %hash = split /$sep/, $string; while ( my ($key,$val) = each %hash ){ print $key, " :: ", $val,"\n"; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my $sep = '<;>'; my $string = 'a<;>eine<;>an<;>eine<;>one<;>eine<;>to have a smoke<;>eine rauchen [ugs.]<;>'; my @info = split /$sep/, $string; my @array; while( @info ){ push @array, [shift @info, shift @info]; } print Dumper \@array;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/usr/bin/perl use strict; use warnings; use Tie::IxHash; my $sep = '<;>'; my $string = 'a<;>eine<;>an<;>eine<;>one<;>eine<;>to have a smoke<;>eine rauchen [ugs.]<;>'; tie my %hash, 'Tie::IxHash'; %hash = split /$sep/, $string; while ( my ($key,$val) = each %hash ){ print $key, " :: ", $val,"\n"; }
my @array = qw/1 2 3 4 5 6/;
@array = ([1,2], [3,4], [5,6]);
1
2
3
4
5
6
my @neuarray=();
for(0..@array/2-1)
{
push @neuarray, [@array[$_*2,$_*2+1]];
}
@array=@neuarray;
6 Einträge, 1 Seite |