1 2 3
foreach my $elem (@liste) { push(@temp_1,[ $elem, ( $elem =~ /<(\d+)>/ )[0] ]); }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#! /usr/bin/perl use strict; use warnings; use 5.010; use Data::Dumper; my $string = "A1B2C3"; # liefert alle drei Zahlen (beachte Modifier /g) my @liste = ( $string =~ m/(\d)/g ); say "@liste"; @liste = ( $string =~ m/(\d)/g )[0]; say "@liste"; @liste = ( $string =~ m/(\d)/g )[1,2]; say "@liste";