fork download
  1. # read data to $input
  2. $/ = undef;
  3. my $input = <main::DATA>;
  4.  
  5. # set $d to be zero
  6. my $d = 0;
  7.  
  8. # assign $input to $_
  9. $_ = $input;
  10.  
  11. # with $_ do the following:
  12. # find all regex matches for d+/d+/d4, where d+ is one or more digits and d4 are 4 digits
  13. # and with each occurrence check if yyyymmdd is larger then $d
  14. # and if so, assign it to $d
  15. s/\s(\d+)\/(\d+)\/(\d{4})\s/{$d = 10000*$3+100*$1+$2 if $d < 10000*$3+100*$1+$2}/eg;
  16.  
  17. # print date $d
  18. print $d;
  19.  
  20. #data to be read by code above
  21. __DATA__
  22. File:tfo.supplement.20120901.done 9/1/2012 3:48:00 AM
  23. File:tfo.supplement.20120901.zip 421144 KB 9/1/2012 3:48:00 AM
  24. File:tfo.supplement.20120904.done 9/4/2012 3:57:00 AM
  25. File:tfo.supplement.20120904.zip 421794 KB 9/4/2012 3:57:00 AM
  26. File:tfo.supplement.20120905.done 9/5/2012 3:28:00 AM
  27. File:tfo.supplement.20120905.zip 421875 KB 9/5/2012 3:28:00 AM
Success #stdin #stdout 0s 4552KB
stdin
Standard input is empty
stdout
20120905