use strict; use warnings; use Time::Local; use JSON; use File::Read; my $jsonc = read_file ('H:\Work\perl\latest\Scripts\logs\json.txt'); { local $/ = "}\n"; while ($jsonc) { s/\n[+]?//gm; my $data = decode_json $_; for (@{$data->{aaData}}) { #my print/parse function } } } #### c:\perl>perl json.pl Use of uninitialized value $_ in substitution (s///) at get.pl line 14. malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "(end of string )") at get.pl line 15.