in reply to extract sequences of certain letters and assign it to a variable

You were almost there:
use strict; use warnings; my $a = "bbzvbvxmgbnmnvxyyz"; my @all = $a =~ m/([zvxg])/g; print @all;
Result:
zvvxgvxz
Or (but it destroys the original contents of the variable):
use strict; use warnings; my $a = "bbzvbvxmgbnmnvxyyz"; $a =~ s/[^zvxg]//g; print $a;

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James