in reply to Find duplicate files with exact same files noted

maybe you want to use File::Spec to split file names, as it should be portable and more reliable. from the docs:
($volume,$directories,$file) = File::Spec->splitpath( $path ); ($volume,$directories,$file) = File::Spec->splitpath( $path, $no_f +ile );

Replies are listed 'Best First'.
Re^2: Find duplicate files with exact same files noted
by Lady_Aleena (Priest) on Aug 17, 2010 at 18:57 UTC

    So, using File::Spec the following would need to be altered.

    my %files; for my $raw_file (@file_list) { my @file_parts = split(/\//,$raw_file); my $file = pop @file_parts; my $file_size = -s $raw_file; push @{$files{"$file ($file_size bytes)"}}, $raw_file; }

    The following is the alteration.

    my %files; for my $raw_file (@file_list) { my ($volume,$directories,$file) = File::Spec->splitpath($raw_file); my $file_size = -s $raw_file; push @{$files{"$file ($file_size bytes)"}}, $raw_file; }

    So, no more spliting and popping for the file name. Thanks for the tip!

    Have a cookie and a very nice day!
    Lady Aleena