I have a string stored in a variable. For instance,
$str = " Opcode called is : CM_OP_xxx "
where xxx changes dynamically and can be either LOGIN or SEARCH..... depends on runtime.
For example :
$str = " Opcode called is : CM_OP_SEARCH "
$str = " Opcode called is : CM_OP_LOGIN "
I want to display all CM_OP_xxx only, from $str on the console using "PERL".
Thanks..
if the string contains " Opcode called is : CM_OP_SEARCH input fucntion"
but if i execute the above statement,
echo " Opcode called is : CM_OP_SEARCH input fucntion" | perl -lne '/: (.*) / && print $1'
the output is coming as "CM_OP_SEARCH input" instead of CM_OP_SEARCH.
Please let me know how to execute this.
2nd Doubt is i want a perl script... how do i embed this in a perl script.