http://qs1969.pair.com?node_id=738117

Sombrerero_loco has asked for the wisdom of the Perl Monks concerning the following question:

Hi monkers! I need to do the next and really, i dont know how. I need to from the $variable that contains the next strings (from an array foreach) BS0-bleble, BS1-bleble, BS2-bleble, BS3-bleble, BS4-bleble and BS5-bleble.. Extract the number and compare (to do the comparison its done) but to split the number from the string, i dont know. I know i must to first of all an split to stract the BSx- from the bleble, im doing that like this:
foreach $var1 (@array) {
($hierarchie,$trash)= split('-',$var1);

}
But i dont know how i should do to split the number from the BSx (from 0 to 5) in another variable. Thanks monks!