friedo and jhourcle are right about this being a job for split, but the problem of capturing matches from a regex is common enough that I think a brief elaboration on friedo's answer would be worthwhile.
Even if you had written
thereby evaluating the RHS in a list context, you still would have ended up with the wrong text in $text, namely whatever was matched by themy ( $text ) = m/\|(.*?\|){5}(.*?)\|(.*?\|){3}(SNOMEDCT)/;
I think it is simpler to use ?: to disable capture in all but those parens for which you actually want to capture something (this is a good programming habit too, because it minimizes the effect that an edit to the regexp will have on the indices of the captured matches).
For example, in your regex only the second set of parens is capturing something of interest, threfore the capture can be disabled in all the others; actually the last set of parens (around SNOMEDCT) is required neither for grouping nor capturing, so you can eliminate it altogether:
my ( $text ) = m/\|(?:.*?\|){5}(.*?)\|(?:.*?\|){3}SNOMEDCT/;
the lowliest monk
In reply to Re^3: unique fields in bar delimited record
by tlm
in thread unique fields in bar delimited record
by jjohhn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |