my $string = '1234'; $string =~ /(2)/; $string =~ /(a)/; print $1; #### - for ( 1 .. $num_refs ) { + for ( $num_refs .. 1 ) {