in reply to parsing multi-line output from a cli command
HTH.my($ticket,$customer,$status,$priority,$owner,$summary); while (<FILE_HANDLE>) { chomp; if (substr($_, 0,1) == " ") { ### 1st char is space - line just be summary line ### my $summary = $_; ### since you now have all the pieces of data, you ### can build your hash and array element, and then ### move on to the next record. } else { ### 1st char is not a space - this is not a summary ### line. ($ticket,$customer,$status,$priority,$owner) = split /\w+/; }
|
|---|