use strict; use warnings; use Test::More tests => 2; my @matches; $_ = '1223w3433.45+34'; @matches = (/\d\D*/g); is $matches[0], 1, 'First time'; @matches = (/\d\D*/g); is $matches[0], 1, 'Second time';