how to grep string and assgin to variable in perl : I have a file with the below details;


cont:i-02dd208bf1d81c254
rs:i-0098ad0b59b7fe7cf
I want to use value for  "i-XXX" in associated "cont" name  and then assign to another variable.
How to achieve this?