Need to understand how the line in perl program works as shell commend

I have a file with two line, one is header, the other actual value:

 TYPCD|ETID2|ETID|LEG ID|PTYP|PTYP SUB|TRD STATUS|CXL REASON|CACT|CACTNM|ENCD|ENC
D NM|TRDR|ASDT|TRDT|MTDT|STDT|LS|SECID|SECID TYP|SECNM|PAR|STCC|MARKET PRICE|DIS
 MARKET PRICE|MARKET PRICE CURRENCY|SRC OF SETTLEMENT PRICE|FICC|LAST PRCDT|MARK
ET VALUE|SECURITY TRADING CURRENCY|SRC OF MARK TO MARKET|SETTLEMENT PRICE|SETTLE
MENT PRICE CURRENCY|FORWARD PRICE|REPO RATE|GSCC FLG|MBSCC FLG|SDTR DAYS|COUPON|
DBEI|TTOC|TRNO|CURR FACTOR|TTDOL|ATCD|ISSUE DT|REG SD DAYS|REG STDT|CDBO|TAXID|C
UST NICK|GRP ACT|AINT|AINT FACTOR|SPCD|EXEMPT|AMS CLASS CD|BPS BRKNO|SEC RATING|
SEC RATING VENDOR|SEC RATING ACTUAL|SEC RATING SRC|REG SEC|CONV|SECC|RTID|CRVI|T
DATE|WI IND|LE
AGY TRADES|F348533S14419861@000|F348533S14419861@000|1|AGY|FRED            |ACTI
VE||2420477290|BLACKROCK FINANCIAL MGMT INC|DMG|DMG |C572|20170421|20170421|2017
0629|20170426|S|3137EADH9|CUSIP|FREDDIE MAC 1% 06/29/2017      |28000|USD|100.03
59382|100.0359382|USD||N|20170424||USD|TRDMRK|100.0367   P|||.5| | |0000000005|1
.000000| | |0007557|1.00000000|28101.28|AGY|20120514|1|20170424|O|20-5319476 |BF
M W-PIOMNI|63032       |91.00|3222.22000000|CW3|N        |10029|||MOODY|Aaa|DBI|
 ||USD|201704210007557|   |20170421||LEREC-CNT=000001

I want to cut it by 13, 19,11,24,21,29 fields
Below is line in Perl, which is not working in shell

 $cmd=("awk -F'|' '{print \$($i_secid+1) \"\|\" \$($i_trdr+1) \"\|\" \$($i_encd+1) \"\|\" \$($i_market_price+1) \"\|\" \$($i_last_prcdt+1) \"\|\" \$($i_secnm+1)}' $if|sort -u");
 `cmd`
 

I just want to understand what it does, so that make it work in Perl on apache server

Thanks for contribution

What do you mean by:

Could you post an example of the output you are looking for?

Perl does not require awk nor sort to do the work. Making outside calls to these other programs indicates that whoever wrote them did not know enough Perl.

It is not mine. We just move it from UNIX to apache , that is why I have to change it. But how? In reality file is huge, 10000 lines. The script was done 10 years ago. I don't even know, what should be the output.