将Perl转换为C#.请帮帮我! [英] Perl to C#. Help me please!
本文介绍了将Perl转换为C#.请帮帮我!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好!我需要将此Perl代码转换为C#.你能帮我吗?
我会很感激...
Hello! I need to convert this Perl code into C#. Can you help me?
I''ll be very grateful...
#!/usr/bin/perl
#
# $URL: svn://domestic/54/doc/inf/perl-problems/examples/perl/find.pl $
# $Id: find.pl 516 2010-11-28 18:31:09Z $
#
use warnings;
sub find($);
sub find($)
{
my $name=shift;
if(-d $name)
{
my $dir;
unless(opendir $dir, $name)
{
warn "$0: Impossible to open «$name»: $!\n";
return;
}
print "$name\n";
$name='' if $name eq '/';
for(readdir $dir)
{
next if $_ eq '.' or $_ eq '..';
find("$name/$_");
}
closedir $dir;
}
elsif(-f $name)
{
print "$name\n";
}
else
{
warn "$0: «$name»: $!\n";
}
}
find($_) for @ARGV;
find('.') unless @ARGV;
推荐答案
URL:svn://domestic/54/doc/inf /perl-problems/examples/perl/find.pl
URL: svn://domestic/54/doc/inf/perl-problems/examples/perl/find.pl
#
#
Id:find.pl 516 2010-11-28 18:31 :09Z
Id: find.pl 516 2010-11-28 18:31:09Z
这篇关于将Perl转换为C#.请帮帮我!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文