Thread Seriennummer (Buchstaben) hochzählen (7 answers)
Opened by Gustl at 2014-01-27 14:27

pq
 2014-01-27 14:49
#173237 #173237
User since
2003-08-04
12208 Artikel
Admin1
[Homepage]
user image
perl macht das für dich =)

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
sub get_new_numbers {
    my ($num, $string) = @_;
    my ($mat, $last5) = $string =~ m/^(\w*)(\w{5})$/ or die "doesn't match";
    my @numbers;
    for (1 .. $num) {
        push @numbers, $mat . ++$last5; # automagie
    }
    return @numbers;
}

Last edited: 2014-01-27 14:50:43 +0100 (CET)
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. -- Damian Conway in "Perl Best Practices"
lesen: Wiki:Wie frage ich & perlintro Wiki:brian's Leitfaden für jedes Perl-Problem

View full thread Seriennummer (Buchstaben) hochzählen