source: vendor/perl/5.8.8/Porting/checkcase.pl

Last change on this file was 3181, checked in by bird, 18 years ago

perl 5.8.8

File size: 533 bytes
Line 
1#!/usr/bin/perl
2# Finds the files that have the same name, case insensitively,
3# in the current directory and its subdirectories
4
5use warnings;
6use strict;
7use File::Find;
8
9my %files;
10find(sub {
11 my $name = $File::Find::name;
12 # Assumes that the path separator is exactly one character.
13 $name =~ s/^\.\..//;
14 push @{$files{lc $name}}, $name;
15 }, '.');
16
17my $failed;
18
19foreach (values %files) {
20 if (@$_ > 1) {
21 print join(", ", @$_), "\n";
22 $failed++;
23 }
24}
25
26print "no similarly named files found\n" unless $failed;
Note: See TracBrowser for help on using the repository browser.