From df073d6e09c0f87fb2e88cc215ace843a5851d4a Mon Sep 17 00:00:00 2001 From: einhverfr Date: Thu, 12 Apr 2007 20:46:20 +0000 Subject: Formatting with Perltidy git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@1068 4979c152-3d1c-0410-bac9-87ea11338e46 --- utils/devel/find-use | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) (limited to 'utils/devel') diff --git a/utils/devel/find-use b/utils/devel/find-use index fa2014f0..c90ddcc5 100755 --- a/utils/devel/find-use +++ b/utils/devel/find-use @@ -1,4 +1,5 @@ #!/usr/bin/perl -w + =head1 NAME find-use @@ -27,7 +28,6 @@ Distributed under the terms of the LedgerSMB code. =cut - use strict; use warnings; @@ -35,25 +35,29 @@ open GREP, "grep -r '^use ' . |"; use Module::CoreList; my %uselines; -while() { - next if /LedgerSMB::/; - next if /use warnings/; - next if /use strict/; - next if /use vars/; - chomp; - my ($file, $useline) = m/^([^:]+):use\s(.*?)$/; - $uselines{$useline}||=[]; - push @{$uselines{$useline}}, $file; +while () { + next if /LedgerSMB::/; + next if /use warnings/; + next if /use strict/; + next if /use vars/; + chomp; + my ( $file, $useline ) = m/^([^:]+):use\s(.*?)$/; + $uselines{$useline} ||= []; + push @{ $uselines{$useline} }, $file; } my %modules; -foreach my $useline (keys %uselines) { +foreach my $useline ( keys %uselines ) { - my ($module) = grep { $_ } $useline =~ /(?:base ['"]([a-z:]+)|([a-z:]+)(?:\s|;))/i; - my $version = Module::CoreList->first_release($module); - $modules{$module} = $version||0; + my ($module) = + grep { $_ } $useline =~ /(?:base ['"]([a-z:]+)|([a-z:]+)(?:\s|;))/i; + my $version = Module::CoreList->first_release($module); + $modules{$module} = $version || 0; } -foreach my $mod (sort { $modules{$a} == 0 ? -1 : $modules{$b} == 0 ? 1 : 0 or $a cmp $b } keys %modules) { - printf "%2.6f : %s\n", $modules{$mod}, $mod; +foreach my $mod ( + sort { $modules{$a} == 0 ? -1 : $modules{$b} == 0 ? 1 : 0 or $a cmp $b } + keys %modules ) +{ + printf "%2.6f : %s\n", $modules{$mod}, $mod; } -- cgit v1.2.3