Buddyholly83
IS-IT--Management
I am being returned some data that looks like:
The bit i am interested in is the Result and messageIDs lines. I can successfully find these lines using:
But what my code is doing is checking if the string contains 'MessageIDs={..}' in the data and it sets $reponse = 1. I infact want the long code part, i.e. i want f89fcc9b-b7ba-44a8-bebe-785302b6f136
How do i extract this ?
Thanks
Code:
Set-Cookie: ASP.NET_SessionId=bir2jo45j0jev355wqdp0xed; path=/
X-AspNet-Version: 1.1.4322
X-Powered-By: ASP.NET
Result=OK
MessageIDs=f89fcc9b-b7ba-44a8-bebe-785302b6f136
Code:
my ($string) = @_;
my $response = undef;
if($string =~ m/Result=Test/)
{
#Return nothing
$response = "Test worked\n";
}
if($string =~ m/Result=OK/)
{
#Return MessageID value
$response = ($string =~ m/MessageIDs=/../eof()/);
}
How do i extract this ?
Thanks