awk to perl convert

Dear Collegue
Do anybody help me to convert this AWK script to Perl script

{
for (i = 2; i <= length ($0); i++) {
x = substr($0, i , 1)
if (c > 0) {
b = b x
if (x == "(") c++
if (x == ")") c--
}
if (c == 0 && substr($0, i, 3) ~ /^\(VP$/) {
if (b) print b
b = x
c++
}
}
}
END {
if (b) print b
}

Jagan

Try a2p :slight_smile:

Thank you very much for this valuable information

With warm regards

Jagan