I'm working on making a BED file but I'm having a problem splitting a variable to get the individual id.
Here are the data
fam_scz_uktr_eur_omni*UK1090_0_pca|PT-BHLS    chr15    20301669 ...
This is my script (I escaped!)
 if( $id =~ m/\|/g){
        @tempID = split "\|", $id;
        $id = pop(@tempID);
    }
    ...
    unless($id =~ m/FID.IID/ || $id =~ m/arrayId/ || $id =~ m/sampleId/){
        $orphan{$id}=$line;
    }
This is the output of the orphan hash
KEY    VALUE
S    fam_scz_uktr_eur_omni*UK1090_0_pca|PT-BHLS    chr15    20301669   ....
It's returning the last character. What gives!?
Am I missing something here? Any help is appreciated :D
Quick question: What are you expecting out of the pop operation? If you're sure the '|' is used only once in a line, why not just take
$tempId[1]?