diff options
Diffstat (limited to 'ColaBBS_to_PttBBS/cntarticle.pl')
-rw-r--r-- | ColaBBS_to_PttBBS/cntarticle.pl | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/ColaBBS_to_PttBBS/cntarticle.pl b/ColaBBS_to_PttBBS/cntarticle.pl index 0567d378..36419b5a 100644 --- a/ColaBBS_to_PttBBS/cntarticle.pl +++ b/ColaBBS_to_PttBBS/cntarticle.pl @@ -1,12 +1,20 @@ #!/usr/bin/perl +# $Id$ use IO::All; die "usage: cntarticle.pl [base dir]" if( !@ARGV ); -foreach( @ARGV ){ - print "converting: $_\n"; - convert($_) - foreach( <$_/M.*.A> ); +@proc = @ARGV; +while( $dir = pop @proc ){ + print "converting: $dir\n"; + while( <$dir/*> ){ + next if( /^\./ ); + if( -d $_ ){ + push @proc, $_; + } elsif( /M\..*\.A/ ){ + convert($_); + } + } } sub convert |