in reply to Help Extract these lines

Something like this:

use warnings; use strict; use Data::Dumper; my $value; my %data; while (<DATA>) { chomp; $value = $1 if /.id.+\s"(.+?)"/; if (/.name.+\s"(.+?)"/) { $data{$1} = $value; } } $Data::Dumper::Pair = ":"; # specify hash key/value separator print Dumper \%data; __DATA__ "id": "xx-ada-qwebasd", "name": "telphone", "id": "fasda-asd-123123-fkja123a", "name": "car", "id": "97f921-a312-fas2", "name": "ball",
Output:
$VAR1 = { 'ball':'97f921-a312-fas2', 'car':'fasda-asd-123123-fkja123a', 'telphone':'xx-ada-qwebasd' };

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me