if ( my( @matches ) = $mystring =~ m/(regexp)/g ) { do_something_with( @matches ); }