The RHS must be fully valid perl code to be evalled. You need to define and concatenate strings.
perl -i.bak -pe "s!(I.*?)(misc:IN 1 )(\d+)(.*?')!qq{${1}misc:OUT 2 } . ${3}/10 . qq{${4}}!e" test.txt
Also note the use of qq{}
for strings since ""
is used on the command line to enclose the perl code.