...and here is my favorite way of doing it...
use strict; use warnings; use Data::Dumper; my @data; while(<DATA>){ push @data, { object => $1 } if /^object (.*)/; $data[-1]->{$1} = $2 if /^ (.*?) (.*)/; } print Dumper \@data; __DATA__ object network Microsoft.Lync.Host.3 host 138.108.25.111 description Help Desk Ticket #476739 object network Microsoft.Lync.Host.4 host 138.108.25.112 description Help Desk Ticket #476739 object network Microsoft.Lync.Host.5 host 138.108.25.113 description Help Desk Ticket #476739 object network Microsoft.Lync.Host.6
In reply to Re: Extract Data Between Lines
by hdb
in thread Extract Data Between Lines
by namelkcip
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |