I am having one problem as stated below 

Problem Description

I am having some "sv" extension files , I am using "glob" to extract the matching files , Now in these matching files , I need to split them and extract the elements and create different lists. 

For example 

```
set files [glob -type f modified_rtl_files/*/*{wrapper_hsm}*]

```

This command gives me these two files :

```
modified_rtl_files/mbist_wrapper/mbist_wpper_hsm_pkram.sv modified_rtl_files/mbi_wrapper/mbist_wrapper_hsm_sysram.sv

```

Now I am extracting the filename with the below command 

```
foreach element $files {
set c [split [ file tail [ file rootname $element ] ] "_" ]
echo $c
}

```

This is giving me 

```
pkram
sysram

```

But I need to set them to two independent list 

```
$mem1 
$mem2 

```

```
$mem1 should be pkram 
$mem2 should be sysram 

```

Whenever I am trying to create something like this , both the elements are getting printed 

```
foreach element $files {                                                                                              
set c [split [ file tail [ file rootname $element ] ] "_" ]                                                                      
set d [ lindex $c 3]                                                                                                             
set mem1 [ lindex  $d 0 ]                                                                                                        
puts $mem1                                                                                                                       
}

```

It is printing both 

```
pkram 
sysram 

```

I want independent variables .