Assuming DATA is your file handle to the list of users:
# store name list in %hash, where key is name or number
# and value is array of actual names
while( ) {
chomp;
# does name have proper number?
if( /(00\d+)/ ) {
$key = $1;
next if !/^(ct|ma|mb)/; # skip those that don't b
I have a file with a list of users.Some of the user names are like this:
ct002345
ct000123
ma005678
ma009876
mb000867
mb002412
sa000100
sb03
sg72
I need to extract just the number(there is 00 before each number and I
want it too) of "ct , ma , mb"(no "sa , ecc.")and all the other users
t