my ( $json, $ref ); for ( $scrape =~ m/\((\{".*?\})\)/gms ) { $json = $1; $ref = decode_json $json; print Dumper $ref; }