我在Perl中有一个子程序,应该像这样缩进:
@H_404_12@sub GetFiles { my $pwd = shift; my @input = @_; my @returned; my @DirectoryContent = &GetContentInformation(@input); foreach (@DirectoryContent) { my %current = %{$_}; if ($current{'info'} =~ /<DIR>/) { my $RecurseDir = &GetRecurseDir($pwd,\%current); push(@returned,&GetFiles($RecurseDir,&GetDirectoryContents($RecurseDir))); } else { # clean up the data my $size = $current{'info'}; # filesize will be in number of bytes # remove file separators #$size =~ s/,//g; my $extension = &GetFileExtension($current{'name'}); delete($current{'info'}); $current{'size'} = $size; $current{'extension'} = $extension; # push(@returned,\%current); } } @returned; }@H_301_2@但是当我按下子程序块的起始括号上的=%(是的,cindent打开)时,它会像下面那样缩进:
sub GetFiles { my $pwd = shift; my @input = @_; my @returned; my @DirectoryContent = &GetContentInformation(@input); foreach (@DirectoryContent) { my %current = %{$_}; if ($current{'info'} =~ /<DIR>/) { my $RecurseDir = &GetRecurseDir($pwd,\%current); push(@returned,&GetDirectoryContents($RecurseDir))); } else { # clean up the data my $size = $current{'info'}; # filesize will be in number of bytes # remove file separators #$size =~ s/,//g; my $extension = &GetFileExtension($current{'name'}); delete($current{'info'}); $current{'size'} = $size; $current{'extension'} = $extension; # push(@returned,\%current); } } @returned; }@H_301_2@为什么这样做?我该如何解决?
编辑:应该注意我在Windows上使用gvim 7.3.