Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Can i get help from you please.#!/usr/local/bin/perl my $data = 'Sending 104 bytes *** POST /path HTTP/1.0^M Content-type: text/xml^M Content-length: 37^M ^M SENT 104 HEADER HTTP/1.1 401 Unauthorised^M Connection: Close^M Content-Length: 0^M ^M <?xml version="1.0" encoding="UTF-8"?> <?path?> '; my @splitdata = split(/\n{2,}/, $data); my $lastValue = pop @splitdata print"Last value => $lastValue\n"; Expected output: Last value=> '<?xml version="1.0" encoding="UTF-8"?> <?path?>'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to split data by ^M^M
by moritz (Cardinal) on Jul 09, 2009 at 13:15 UTC | |
by zwon (Abbot) on Jul 09, 2009 at 17:57 UTC | |
by moritz (Cardinal) on Jul 09, 2009 at 18:22 UTC | |
|
Re: how to split data by ^M^M
by BioLion (Curate) on Jul 09, 2009 at 13:14 UTC | |
by Anonymous Monk on Jul 09, 2009 at 13:56 UTC | |
by BioLion (Curate) on Jul 09, 2009 at 14:23 UTC | |
|
Re: how to split data by ^M^M
by biohisham (Priest) on Jul 09, 2009 at 15:33 UTC | |
by kulls (Hermit) on Jul 10, 2009 at 09:13 UTC |