in reply to extract pattern from large blob of text

@- and @+ are arrays, as documented in perlvar. Maybe you wanted to actually capture things?

My approach would be to also capture the nonce value in the same regular expression match:

if( $message =~ /nonce\s+=\s+"([^"]+)"/ ){ my $nonce= $1; print "Found nonce: $nonce\n"; } else { die "No nonce found in message:" . $message; };

Replies are listed 'Best First'.
Re^2: extract pattern from large blob of text
by littleperl (Initiate) on Mar 06, 2015 at 14:51 UTC

    very usable example, thx

    Seems the formatting of $message is not correct to me, I have added how I get to the content of $message to the original post.

      If you think the formatting of $message is not what you want it to be, what steps have you taken to confirm this?

      Maybe printing $message might show you the content?

        The message was strangly not existing at the place I wanted to use it for this extract. so got that solved, thx :)