How to grep the string in perl.
Variable sessionWeb contains a web page html code. I want to grep "active Sessions" from this and want to print as below. For example the line in the web page will be
"2 active Sessions, 0 passivated Sessions (more stats...)"
2 active Sessions.
I have tried the following code but it is not working ?
$sessionStr="active Sessions"; $sessionCount =~ grep( /$sessionStr/,$sessionWeb);