if ($test_data_001 =~ /^__BEGIN_DATA__\n(.*)\n__END_DATA__$/s) { # some action }