in reply to Re^2: nth field extraction
in thread nth field extraction
You might have not recognized the significance of \Q in return (split /\Q$sep/, $source)[ $field-1 ]); The \Q says to ignore any characters in $sep that would otherwise mean something to the regex engine. I often use a \Q...\E pair for this just to highlight this situation. Anyway without \Q, if $sep contains something that matters to the regex engine, you will get confusing results.
|
|---|