check_links.pl 414 B

1234567891011121314151617181920
  1. #!/usr/bin/perl
  2. # Check that every solution has the correct link to the problem.
  3. use 5.020;
  4. use File::Find;
  5. use File::Slurper qw(read_text);
  6. find {
  7. wanted => sub {
  8. if (/^(\d{3}) /) {
  9. my $d = $1 =~ s/^0+//r;
  10. my $content = read_text($_);
  11. if (not $content =~ /problem=$d\b/) {
  12. say "$File::Find::dir/$_";
  13. }
  14. }
  15. }
  16. } => '.';