in reply to extract syntaxes from file into array, as new file
use strict; use warnings; my %results; $_ = join '', <DATA>; ($results{'no_of_items'}) = m/Number of Items\s+:\s+(\d+)/; ($results{'size_of_store'}) = m/Size of the Store\s+:\s+(\d+)/; ($results{'aa'}, $results{'ba'}, $results{'ab'}, $results{'bb'}) = m/\ +s+a\s+b\s+<-- classified as\s+(\d+)\s+(\d+)\s+\|\s+\w+ = \d+\s+(\d+)\ +s+(\d+)/; ### Just to display what's in hash, you still need to output it in you +r format use Data::Dumper; print Dumper(\%results); __DATA__ start of tree ------------------ Da | something > 1234: 1 (81.06/25.89) Number of Items : 15 Size of the Store : 30 something else here === Summary Matrix === a b <-- classified as 11111 222 | a = 0 3333 444 | b = 1
|
|---|