Vasek has asked for the wisdom of the Perl Monks concerning the following question:
### code from here ### @classedSources = ( "hitdb/CustomerPartner/Opten/Scripts/Daily/egy_batch.sql", "hitdb/CustomerPartner/Opten/Scripts/Daily/megegy_batch.sql", "hitdb/CustomerPartner/Opten/Scripts/Other/cp_OptenTruncTables.sql", "hitdb/CustomerPartner/Opten/Scripts/Other/htcp_firm_loadAll.sql", "hitdb/CustomerPartner/Opten/Scripts/Other/runHT_CP_EKN.sql", "hitdb/CustomerPartner/Opten/Scripts/Other/runHT_CP_FIRM.sql", "hitdb/Policy/Views/Types/HtTypoWsAlaTarifFE1.sql", "hitdb/Policy/Types/HtTypoWsHobMfactorFE1.sql", "hitdb/Policy/Types/HtTypoWsCoverAlaFE1.sql", "hitdb/Policy/Views/Types/HtTypoWsCoverAlaFE1.sql", "hitdb/Policy/Types/HtTypoWsCoverAlaListFE1.sql", "hitdb/Policy/Views/Types/HtTypoWsCoverAlaListFE1.sql", "hitdb/Security/Scripts/ht_tut_mail_address_ws.sql", "hitdb/Policy/Views/Types/HtTypoWsHobMfactorFE1.sql", "hitdb/Accounting/Scripts/ht_tut_mail_address_ws.sql", "hitdb/Policy/Scripts/ht_tut_mail_address_ws.sql", "hitdb/Policy/Types/HtTypoWsAlaTarifFE1.sql", "hitdb/astools/as#arch/Setup/Scripts/ht_tut_mail_address_ws.sql" ); foreach (@classedSources) { my @path = split /\//, $_; my $file = pop @path; my $path = join '/', @path; @sourcesAndPaths = (@sourcesAndPaths, "$file|$path"); } print "\n"; print "-" x 80, "\n"; print "-- REPEATED SOURCE(S):\n"; print "-" x 80, "\n"; @sourcesAndPaths = sort @sourcesAndPaths; foreach (@sourcesAndPaths) { $fileidx++; my ($file, $path) = split /\|/, $_; my ($nextFile, $nextPath) = split /\|/, $sourcesAndPaths[$fileidx]; if ($file eq $nextFile) { $hit = 1; $hitcntr++; print "\n$file\n" if $hitcntr == 1; print " " x 6, $path."\n"; } else { print " " x 6, $path."\n" if $hit; $hit = ''; $hitcntr = ''; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: sorting a filelist array by filename
by Util (Priest) on May 19, 2009 at 15:28 UTC | |
|
Re: sorting a filelist array by filename
by roubi (Hermit) on May 19, 2009 at 15:38 UTC | |
|
Re: sorting a filelist array by filename
by tweetiepooh (Hermit) on May 19, 2009 at 16:01 UTC | |
by Vasek (Acolyte) on May 19, 2009 at 23:19 UTC | |
by toolic (Bishop) on May 19, 2009 at 23:36 UTC | |
by Vasek (Acolyte) on May 20, 2009 at 07:33 UTC | |
|
Re: sorting a filelist array by filename
by dwm042 (Priest) on May 19, 2009 at 23:07 UTC | |
|
Re: sorting a filelist array by filename
by bichonfrise74 (Vicar) on May 20, 2009 at 04:47 UTC |