in reply to capturing the numerous hits from a global match into nested data

you're close!

my $string = "abcd\x66\x69\x8f\xfe"; print "string is ",length($string), " characters long.", $/; my @matches = $string =~ /([^\x01-\x7f])/go; print "string has ",scalar(@matches), " characters in \\x80-\\xff.", $ +/; print "the string$/"; hex_print($string); my $count; printf("match %02d has value %02X$/", $count++, ord $_) for @matches; sub hex_print { my $string = shift; for my $a ( 0, 1 ) { print( map( { substr $_, $a, 1 } map { sprintf "%02X", ord $_ } split //, $string ), $/ ); } }
  • Comment on Re: capturing the numerous hits from a global match into nested data
  • Download Code