#!/usr/bin/perl use strict; use warnings; my @data = reverse ; my $notfound = 1; while ($notfound) { $data[0] =~ /\{/ and $notfound = 0 and last; shift @data if $notfound; } @data = reverse @data; __DATA__ 12 i0 { xo 46 { 28 98