http://www.perlmonks.org?node_id=1002069

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I want to parse the following text file and return the location whose status is approved and build date is the latest,please provide inputs on the logic.

INPUT:- Build: M1234BAAAANAAW9321.1 Location: \\dreyers\builds468\INTEGRATION\M1234BAAAANAAW9321.1 Comments: Build completed, labeled, and marked for retention. Status: Approved BuildDate: 10/25/2012 12:51:25 Build: M1234BAAAANAAW9321.2 Location: \\crmbld01\Builds\FAILED\M1234BAAAANAAW9321.2 Comments: The build is currently in a failed status. Status: Failed BuildDate: 10/25/2012 19:37:17 Build: M1234BAAAANAAW9321.3 Location: \\freeze\builds427\INTEGRATION\M1234BAAAANAAW9321.3 Comments: Build completed, labeled, and marked for retention. Status: Approved BuildDate: 10/25/2012 19:43:28 OUTPUT:-\\freeze\builds427\INTEGRATION\M1234BAAAANAAW9321.3